Welcome to the NeoThinBasic Forum

Topics related to David de Argentina's NeoThinBasic plug-in.

Moderator: Neosoft Support

Post Reply
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Welcome to the NeoThinBasic Forum

Post by David de Argentina »

Hi all,

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
PlayScript: Sends Actions to be executed by NeoBook.
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)
Usage: ae_TB_GetParametersList "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_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>>>
Usage: ae_TB_SetVar "VarName" "VarValue" "VarType"
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)
Returns: None. is program-dependant

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")
Returns: None

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")
Returns: ThinBasicVar

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")
Returns: ThinBasicVar

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
Third Directive: Declare all Global Variables you must use in combination with NeoBook

Code: Select all

Global sVarName as string
Global nVarAge as long
Global sVarAddress as string
'<<<sVarName>>>
'<<<nVarAge>>>
'<<<sVarAddreess>>>
Fourth directive: Your main program goes here.

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 !
Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Re: Welcome to the NeoThinBasic Forum

Post by Neosoft Support »

This looks very cool! Thank you for sharing it with us.
NeoSoft Support
User avatar
dec
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain
Contact:

Re: Welcome to the NeoThinBasic Forum

Post by dec »

Hello,

Taking a look at some of the samples (Chart and Grid) I am really impressed David, very good job! 8)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: Welcome to the NeoThinBasic Forum

Post by David de Argentina »

Thanks dec,

I think the union between NeoBook and thinBasic put NeoBook in another dimension...

Greetings from Buenos Aires,
David de Argentina
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Welcome to the NeoThinBasic Forum

Post by dpayer »

David de Argentina wrote:Thanks dec,

I think the union between NeoBook and thinBasic put NeoBook in another dimension...

Greetings from Buenos Aires,
David de Argentina
You are probably right on this David. I do plan to jump into this as soon as I can set aside several hours to study the process you have set up and the syntax needed to implement TB in our NeoBook environment.

Thanks for sharing this with us.

David P.
David Payer
Des Moines, Iowa
USA
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: Welcome to the NeoThinBasic Forum

Post by David de Argentina »

Thanks DavidP,

I think there is a good place to create / improve useful samples, the best way to learn anything.

BTW, do you know a good book to learn drive a bike ? :lol:

David de Argentina
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Welcome to the NeoThinBasic Forum

Post by dpayer »

David de Argentina wrote:Thanks DavidP,

I think there is a good place to create / improve useful samples, the best way to learn anything.

BTW, do you know a good book to learn drive a bike ? :lol:

David de Argentina
I will help you find a nice ebook publication on how to ride a bike :)

I have been reviewing the ThinBasic help pages online. That's how I work best.... read the docs to see what my new 'vocabulary' will be like.

D
David Payer
Des Moines, Iowa
USA
User avatar
fkapnist
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece
Contact:

Re: Welcome to the NeoThinBasic Forum

Post by fkapnist »

The new ThinBasic beta has a visual designer (thinAir.exe) which is very useful if it can interact with Neobook variables....
http://www.thinbasic.com/community/showthread.php?12478

There is also FreeBasic with IDE but no visual designer
http://fbide.freebasic.net/

Is the NeoThinBasic plugin ready? Which is the final version? I downloaded 2 from this post. One has a helper dialog box to locate folders and files, the other doesn't.... Where is the plugin home page to download from?

:?:
.
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: Welcome to the NeoThinBasic Forum

Post by David de Argentina »

Hi fkapnist ,

Plugin is ready and stable.
Current version is 1.06

See:
viewtopic.php?f=34&t=20219

Greetings from Buenos Aires,
David de Argentina
mishem
Posts: 581
Joined: Mon Oct 08, 2012 1:51 pm

Re: Welcome to the NeoThinBasic Forum

Post by mishem »

At the moment there are two problems.

Options>Install Plug-Ins>Register>OK


Image


ae_TB_GetVar

If the variable is empty or does not exist (for some reason)

Image
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Re: Welcome to the NeoThinBasic Forum

Post by David de Argentina »

Hi mishem

Tell me your email, and i will send you the thinbasic (powerbasic) include file you need for your develop.

The include file is the function definitions (parameters, types, etc)

Greetings from Buenos Aires,

David de Argentina
Post Reply