ClassesClasses | | Operators

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

importimportImportImport (Operator)

Name

importimportImportImport — Import one or more external procedures.

Signature

import( : : ProcedureSource : )

Herror import(const char* ProcedureSource)

Herror T_import(const Htuple ProcedureSource)

void Import(const HTuple& ProcedureSource)

static void HOperatorSet.Import(HTuple procedureSource)

Description

The importimportImportImportImport 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 importimportImportImportImport statement but not for other procedures.

importimportImportImportImport statements may occur in any line of a procedure. The imported procedures become only available below the importimportImportImportImport statement and may be overruled by later importimportImportImportImport 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 ProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource 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 interprets the path as being relative to the file location of the procedure that contains the importimportImportImportImport 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 importimportImportImportImport statement for external procedures but not recursively in its subdirectories.

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

However, ProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource 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%.

importimportImportImportImport neither tests whether the path ProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource exists nor whether it points to a procedure library or a directory that contains procedures at all. Therefore, importimportImportImportImport statements with nonexistent 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 importimportImportImportImport 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

ProcedureSourceProcedureSourceProcedureSourceProcedureSourceprocedureSource (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

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

Result

importimportImportImportImport is never executed.

Module

Foundation


ClassesClasses | | Operators