PDA

View Full Version : a not necessary IDE for thinbasic



zak
20-06-2010, 12:33
Hi
the thinbasic example here C:\thinBasic\SampleScripts\UI\RichEdit\RichEdit_002.tbasic
can be used as an ide for other programming languages who have not an ide, i have added to it a button so its picture is like this:
http://img97.imageshack.us/img97/4522/richedit.png
and attached to the button the following lines:

Case %IDBTN_RUN
Control Get Text CBHNDL, %ID_EDITOR To tbasiccode
FILE_Save("tbfile.tbasic", tbasiccode)
OS_Shell(OS_Environ("COMSPEC") + " /C c:\thinbasic\thinbasic.exe tbfile.tbasic",%OS_WNDSTYLE_NORMAL,%OS_SHELL_SYNC)
Refresh = %TRUE

you write a code in the rich text box , when you click Run... the contents of the box will be saved to a temporary file "tbfile.tbasic", then using the shell running thinbasic.exe over this file. but i do not know which is more correct to call thinbasic.exe or thinbasicc.exe ?

i have tried this richedit program to run perl code successfully, the only shortage is the ability to highlight the keywords. other than that it is a good editor and ide.
attached the modified file, you can change it to run other programs.

ErosOlmi
20-06-2010, 13:06
Nice ida.

Better not to hard code thinBasic path because it can be different depending on installation.
You can get thinBasic.exe full path inside your script using something like:

APP_Path & APP_Name

What to use, thinBasic.exe or thinBasicc.exe?
Better to use thinBasic.exe always and leave thinBasicc.exe only for those scripts that need stdout (standard output) piping like CGI scripts.

Eros

ErosOlmi
20-06-2010, 13:11
Another option is to use CodeMax edit control, the same editor control used for thinAir.
Attached a thinBasic script example on how to use it.

Ciao
Eros