ThinBASIC Modules

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

ThinBASIC Modules

 

What are Modules?

 

Modules are the Core part of thinBasic. Modules are special DLL specifically designed for thinBasic script language. Modules contain all the keywords managed by thinBasic language.

 

How to use modules

 

Inside your script, before calling any module specific keyword, add the following:

 

USES "ShortModuleName"

MODULE "LongModuleName"

 

where ShortModuleName or LongModuleName is the name of the module you want to use.

 

If a script try to use a specific module keyword before loading relevant module, thinBasic generates a run-time error.

 

Modules types

 

There will be 2 type of modules: official modules and user defined modules.

 

Official modules

 

Official modules are modules developed directly by thinBasic team and will be maintained by thinBasic.

All official modules will be named "thinBasic_" + ShortModuleName + ".DLL"

Official modules are loaded inside a script using USES keyword followed by ShortModuleName. ShortModuleName is the text between "thinBasic_" and ".DLL"

 

For example:

FILE module is inside <thinBasicPath>\Lib\thinBasic_FILE.DLL

to use FILE module keywords, add USES "FILE" inside you script.

thinBasic will automatically search for thinBasic_FILE.DLL and connect it to current script execution.

 

User defined modules

 

User defined modules are modules developed by thinBasic users using thinBasic module SDK development interface.

User modules can be names freely.

 

To be able to use a user defined module, it must be placed under one of the following directory:

<thinBasicPath>\Lib\

<thinBasicPath>\Mod\

<thinBasicPath>\Bin\

 

Official modules are loaded inside a script using MODULE keyword followed by FullModuleName.

 

For example:

MyModule module is inside <thinBasicPath>\Mod\MyModule.DLL

to use MyModule module keywords, add MODULE "MyModule" inside you script.

thinBasic will automatically search for MyModule.DLL and connect it to current script execution.

 

 

Special Modules

 

There is only one special module: "CORE" module.

 

Core module is special because it is loaded automatically by thinBasic itself during script engine runtime.

Core module contains all the main keywords related to:

program flow

string handling

numeric handling