ClassesClassesClassesClasses | | | | Operators

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

importimportImportimportImportImport (Operator)

Name

importimportImportimportImportImport — Import one or more external procedures.

Signature

import( : : ProcedureSource : )

Herror import(const char* ProcedureSource)

Herror T_import(const Htuple ProcedureSource)

Herror import(const HTuple& ProcedureSource)

void Import(const HTuple& ProcedureSource)

void HOperatorSetX.Import([in] VARIANT ProcedureSource)

static void HOperatorSet.Import(HTuple procedureSource)

Description

The importimportImportimportImportImport statement can be used to import additional external procedures from within a HDevelop program. The imported procedures become only available for the procedure that contains the importimportImportimportImportImport statement but not for other procedures.

importimportImportimportImportImport statements may occur in any line of a procedure. The imported procedures become only available below the importimportImportimportImportImport statement and may be overruled by later importimportImportimportImportImport statements.

  proc()
  * unresolved procedure call

  import ./the_one_dir
  proc()
  * resolves to ./the_one_dir/proc.hdvp

  import ./the_other_dir
  proc()
  * resolves to ./the_other_dir/proc.hdvp

The parameter ProcedureSourceProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource points to the source of the external procedures. It can either be the path of a directory that contains the procedures and/or the procedure libraries to be used or directly the file name of a procedure library. In both cases, the path may either be absolute or relative. In the latter case, HDevelop interpretes the path as being relative to the file location of the procedure that contains the importimportImportimportImportImport statement. The path has to be in quotes if it contains one or more spaces, otherwise the program line will become invalid.

Contrary to system, user-defined, and session directories HDevelop looks only in the directory specified by an importimportImportimportImportImport statement for external procedures but not recursively in its subdirectories.

Note, that an importimportImportimportImportImport statement is never executed and, therefore, ProcedureSourceProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource has to be evaluated already at the procedure's loading time. Therefore, ProcedureSourceProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource has to be a constant expression, and, in particular, it is not possible to pass a string variable to ProcedureSourceProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource.

However, ProcedureSourceProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource may also contain environment variables, which HDevelop resolves accordingly. Environment variables, regardless of the platform actually used, must always be denoted in Windows syntax, i.e., %VARIABLE%.

importimportImportimportImportImport neither tests whether the path ProcedureSourceProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource exists nor whether it points to a procedure library or a directory that contains procedures at all. Therefore, importimportImportimportImportImport statements with nonexistant or pointless paths nonetheless stay valid program lines, in any case.

Import paths are listed separately in HDevelop's procedure settings. Of course, these paths can't be modified or deactivated from within the procedure settings. Furthermore, procedures that are available only via an importimportImportimportImportImport statement are marked with a special icon.

In the program listing, import statements are displayed and must be entered without parenthesis in order to emphasize that the line is a declaration and not an executable operator.

Parameters

ProcedureSourceProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

File location of the external procedures to be loaded: either a directory or a procedure library

Result

importimportImportimportImportImport is never executed.

Module

Foundation


ClassesClassesClassesClasses | | | | Operators