$LIBRARY Statement

Previous  Next

 

$LIBRARY "file [/system|/base]"

 


 

Loads a MyBASIC2 extension library. Library will be active until current MyBASIC2 module terminates (END/STOP).  The Extension library will add functions and constants to current MyBASIC2 Environment.  There are 2 librray options that can be used;

 

/system        - This will load the library as a system library.  A system library will

                 stay at the topmost level until the interpreter is closed.  This will make

                 the library available to all sub interpreters as well as the current.

 

/base          - This will load the library at the topmost level but it will be removed as

                 soon as the current script has ended.

 

The following Session Variables can be used with LIBRARY:

 

%AppFolder%    - Folder of application. MyBASIC2.exe for example

%CommonFolder% - Points to Current Common Files folder (Program Files (x86)\Common Files)

%SourceFolder% - Folder of calling MyBASIC2 file

 

Uses "MyBASIC2_Lib" environment variable to search for library file.

 

Example:

 

$INCLUDE "MyBASIC2.bas"

$INCLUDE "%SourceFolder%\_INCLUDE\MaxA.bas"

$LIBRARY "%CommonFolder%\MyBASIC2_GraphLib.dll"

$LIBRARY "mybasic2_extlib.dll"

 

DIM nStatus AS INTEGER

 

' Run the Position vs Position Options Dialog

nStatus = CALL MA_Common@DoOptionsDialog( MA_PosPosOptions, MA_PosPosProcess, MA_hProfile )

 

DIM nControl AS INTEGER

 

' Create a Graph using MyBASIC2_Graph

nControl = GRAPH.CREATE( "Kalle Anka", WS_VISIBLE+WS_CAPTION, 0, 0, 640, 480 )

GRAPH.OPTIONS( nControl, "c:\graph.xml", NG_Open )

 

END