Declare (statement)

<< Click to Display Table of Contents >>

Declare (statement)

Declare Sub Name Lib LibName$ [Alias AliasName$] [(Parameters)]

Or:

Declare Function Name Lib LibName$ [Alias AliasName$] [(Parameters)] [As Type]

Declares a procedure or a function contained in a Dynamic Link Library (DLL).

Name is the name of the procedure or function.

LibName is the name of the DLL in which the procedure or function resides.

AliasName is the name under which the procedure or the function is exported from the DLL. If AliasName is omitted, it will be the same as Name. An alias is required, for example, if the exported name is a reserved name in SoftMaker Basic or contains characters which are not allowed in names.

Parameters is a comma-separated list of parameter declarations (see below).

Type specifies the data type (String, Integer, Double, Long, Variant). Alternatively, the type can be indicated by appending a type suffix (e.g. % for Integer) to the function name (see the section Data types).

The Declare statement can be used only outside of Sub and Function declarations.

Declaring parameters

[ByVal | ByRef] Variable [As Type]

The keywords ByVal or ByRef (default value) are used to indicate whether the parameter is passed by value or by reference (see the section Passing parameters via ByRef or ByVal).

Type specifies the data type (String, Integer, Double, Long, Variant). Alternatively, the type can be indicated by appending a type suffix (e.g. % for Integer) to the variable name (see the section Data types).

See also: Call, section Calling functions in DLLs