Xbasic

IMPORT PACKAGE

Syntax

IMPORT PACKAGE < Package_Name as C >

Arguments

Package_Name

The name of an Xbasic script in which multiple functions are declared.

Description

The name of an Xbasic script in which multiple functions are declared.

Discussion

Package_Name is the name of an Xbasic script in which multiple functions are declared. The IMPORT PACKAGE command makes the functions in Package_Name available in the calling script. Using the IMPORT PACKAGE command has lower overhead than INCLUDING the Package_Name, and it also has fewer size limitations. If the IMPORT PACKAGE command is issued several times, only one copy of the Package_Name script is imported.

Imported scripts can themselves use the IMPORT PACKAGE command. The parent script only sees the functions that it (the parent script) explicitly imports.

The import script is not executed. Only the functions declared in the imported script are imported.

Example 

The following script, 'MyFunctions', declares 3 functions.

function one as N()
    one = 1
end function
function two as N()
    two = 2
end function
function three as N()
    three = 3
end function

The following script imports the ' MyFunctions ' script, then calls the functions in MyFunctions.

IMPORT PACKAGE MyFunctions
ui_dlg_box("Hello","result " + ( one()+ two()+ three()))

Limitations

Desktop Applications Only

See Also