Welcome to the NeoThinBasic Forum
NeoThinBasic is a plugin that works as "Bridge" between NeoBook and ThinBasic.
ThinBasic is an interpreted language, like NeoBook.
ThinBasic syntax is like VBScript, but very very very more robust.
ThinBasic run its programs like a rocket, specially indicated for very complex or recursive process.
ThinBasic has the capability to work in Console Mode, Windowed Mode or Special Window Mode, such as OpenGL programs.
You can run programs without any kind of interface also.
ThinBasic has a very big set of functions, you can learn about them with the help file or using the online help at:
http://www.thinbasic.org/public/applica ... nbasic.htm
The download link of the plugin is:
https://app.box.com/s/vjm9bx240m354wzfbjgp
Features
At this moment, you can do the following actions:
a) at NeoBook side:
ae_TB_Reset: Resets all ThinBasic engine.
ae_TB_Init: Inits the ThinBasic engine.
ae_TB_LoadScript: Loads a *.tBasic file.
ae_TB_GetParametersList: Gets the Global variables of the .tBasic file Before Run.
ae_TB_SetVar: Changes / Assigns value to a ThinBasic variable
ae_TB_Run: Runs the ThinBasic .tBasic program file.
ae_TB_GetScriptVariables: Gets a list of the Script Variables After Run.
ae_TB_GetVar: Get the value of a ThinBasic variable After Run.
ae_TB_SendCommand: Interacts with ThinBasic CallBack Function, sending commands.
*.tBasic files are the source code of thinBasic, like the *.PUB into NeoBook.
This files are plain text, and can be edited using any text editor, like notepad.
b) at ThinBasic side:
In order to use this functions, you need declare into your tBasic program the following lines:
Code: Select all
Declare SUB PlayScript Lib "NeoThinBasic.nbp" (BYVAL Script as string)
Declare SUB SetVariable Lib "NeoThinBasic.nbp" (BYVAL Variable as String, BYVAL sValue as String)
Declare FUNCTION GetVariable Lib "NeoThinBasic.nbp" (ByRef VarName AS STRING) as String
Declare FUNCTION GetObjectHandle Lib "NeoThinBasic.nbp" (ByRef sname AS STRING) AS LONG
SetVariable: Sets / Changes a NeoBook variable value.
GetVariable: Gets the Value of a NeoBook Variable.
GetObjectHandle: Get the handle of a NeoBook Object.
a brief explanation of the mode of use of each action:
ae_TB_Reset
Purpose: Reset all ThinBasic engine.
Usage: ae_TB_Reset
Arguments: None
Returns: [ae_TB_InitStatus] Variable. Could be "Ok" or "Error"
ae_TB_Init
Purpose: Init ThinBasic engine.
Usage: ae_TB_Init
Arguments: None
Returns: [ae_TB_InitStatus] Variable. Could be "Ok" or "Error"
ae_TB_LoadScript
Purpose: load a ThinBasic source code from file or variable.
Usage: ae_TB_LoadScript "FileName or Text" "F or V"
Arguments:
FileName or Text: the fullpath to the.tBasic file or the variable with the thinBasic source code
Input Type: F for File or V for Variable (or string directly). Usage only one letter: F or V
Returns: None
ae_TB_GetParametersList
Purpose: Get a List of the parameters used into the thinBasic source code BEFORE RUN
The parameters are the variables you need set before run the script.
you could add any parameters adding into the thinBasic source code the following format
'<<<ParameterName>>>
Note the single quote at the begin of the text.
thinBasic example:
Code: Select all
Global YourName as string 'Always declare as Global the variable before use it
'<<<YourName>>>
MsgBox (0, "Hello " & YourName)
Arguments:
ReturnVar: Is the name of the NeoBook Variable to put the list of parameters
Delimiter: is the character to separate the Parameters. Usually [#13][#10] (best to use into a ListBox)
Returns: [ReturnVar] NeoBook Variable.
ae_TB_SetVar
Purpose: Changes / Assigns value to a ThinBasic variable
You must declare the variable previous to set the value
Code: Select all
Global YourName as string 'Always declare as Global the variable before use it
'<<<YourName>>>
Arguments:
VarName: The Name of the ThinBasic Variable (in the sample: "YourName"
VarValue: The value for the ThinBasic Variable, like "David", "John Doe", etc
VarType: N for Numeric variable, S for string Variable.
Using previous sample, the function should be something like:
ae_TB_SetVar "YourName" "John Doe" "S"
Returns: [ae_TB_Data] Variable, with all ThinBasic source addapted with the new variable value
ae_TB_Run
Purpose: Run the ThinBasic program
Usage: ae_TB_Run "Registration Key"
Arguments:
Registration Key: is the key i provide you.
Returns: No variables. is program-dependant.
ae_TB_GetScriptVariables
Purpose: Get a List of the parameters used into the thinBasic source code AFTER RUN
Usage: ae_TB_GetScriptVariables "ReturnVar" "Delimiter"
Arguments:
ReturnVar: Is the name of the NeoBook Variable to put the list of parameters
Delimiter: is the character to separate the Parameters. Usually [#13][#10] (best to use into a ListBox)
Returns: [ReturnVar] NeoBook Variable.
ae_TB_GetVar
Purpose: Get the value of a thinBasic Variable after run
Usage: ae_TB_GetVar "ThinBasicVar" "NeoReturnVar"
Arguments:
ThinBasicVar: is the name of the ThinBasic variable
NeoReturnVar: is the name of the NeoBook Return Variable
Returns:
[NeoReturnVar.Type] Variable. Could be "S" for String or "N" for Numeric
[NeoReturnVar.Value] Variable. The value of the variable
ae_TB_SendCommand
Purpose: Interacts with the Callback thinBasic function, sending commands. Is the way to run functions within the thinBasic program.
Usage: ae_TB_SendCommand "ThinBasicWinHandle" "Message" "Value"
Arguments:
ThinBasicWinHandle: is the handle of the ThinBasic dialog or window
Message: is the command you send to the Callback function. usually "273" (WM_COMMAND)
Value: the number of message that be processed by the Callback function.
Returns: None. is program-dependant
PlayScript
Purpose: Execute a NeoBook Action or SubRoutine
Usage: PlayScript "NeoBookAction"
Arguments:
NeoBookAction: Like: "Gosub " + $DQ + "NeoFunction" + $DQ
Example:
Code: Select all
Local sAction as string
sAction = "AlertBox " + $DQ + "ThinBasic Executes NeoBook" + $DQ + " " + $DQ + "Hello World, Hello NeoBook" + $DQ
PlayScript(sAction)
SetVariable
Purpose: Change / assign value to a NeoBook Variable
Usage: SetVariable "NeoBookVar" "Value"
Arguments:
NeoBookVar: The NeoBook Variable
Value: The value to store into
Example:
Code: Select all
SetVariable("NeoVar", "Hello World")
GetVariable
Purpose: Get the value from a NeoBook Variable
Usage: ThinBasicVar = GetVariable "NeoBookVar"
Arguments:
NeoBookVar: The NeoBook Variable
Example:
Code: Select all
Local ReturnString as string
ReturnString = GetVariable("NeoVar")
GetObjectHandle
Purpose: Get the handle of a NeoBook Object
Usage: ThinBasicVar = GetObjectHandle "NeoBookObject"
Arguments:
NeoBookObject: The NeoBook Object, like "Button1"
Example:
Code: Select all
Local ReturnLong as Long
ReturnLong = GetObjectHandle("Button1")
Structure of a ThinBasic Program
This help does not replace the Help File, please read it for detailed explanations
First Directive: USES
Tells to a ThinBasic what kind of services you need into the program
Examples:
Uses "Console"
Uses "UI" (For windowed programs)
Uses "Math" (for combination or permutations)
Uses "OS" (for OS enviroment functions)
etc
Second directive:
Declare (if needed) the 4 functions for communication with NeoBook
Code: Select all
Declare SUB PlayScript Lib "NeoThinBasic.nbp" (BYVAL Script as string)
Declare SUB SetVariable Lib "NeoThinBasic.nbp" (BYVAL Variable as String, BYVAL sValue as String)
Declare FUNCTION GetVariable Lib "NeoThinBasic.nbp" (ByRef VarName AS STRING) as String
Declare FUNCTION GetObjectHandle Lib "NeoThinBasic.nbp" (ByRef sname AS STRING) AS LONG
Code: Select all
Global sVarName as string
Global nVarAge as long
Global sVarAddress as string
'<<<sVarName>>>
'<<<nVarAge>>>
'<<<sVarAddreess>>>
Fiveth directive: the callback function (if any) goes here
With all this settings you can do your own tBasic programs.
I will put a lot of samples on the following posts.
Have fun !
David de Argentina
PS: Dave: could you put this topic as Anouncement ? Thanks !