Thanks a lot Petr.
I have PSPad installed since many year and I can say it does its job.
PSPad is general purpose "programmers" text editor, which can be used for editing and running ThinBASIC scripts as well. The following text will guide you step by step to make PSPad your IDE for ThinBASIC.
Step #1: Download and install PSPad
PSPad comes in various language versions, I recommend the English one.
You can download it from here:
PSPad Download [ENGLISH]
It is possible that after installation, PSPad will autodetect your language and "localize" itself automagically.
Step #2: Adding syntax definition
Use following script to generate INI file for you, move that INI to:
\PSPad editor\Syntax\ThinBASIC.ini
[code=thinbasic]
' -- Script to generate ThinBASIC.ini for PSPad
uses "ADO","Biff","Bundle","CGI","COM","COMM","Console","Crypto","Dictionary","DT","Eval","Exe","FBGFX","File","FileLine","FTP","GDIp","Inet","INI","LAN","LL","Math","OnlineScores","OS","Oxygen","PC","RAS","Registry","SAPI","SMTP","STAT","TBASS","TBDI","TBEM","TBGL","TcpUdp","Tokenizer","UI","UIAdv","VBRegExp","WMI","XPRINT","ZLIB"
dim iniOut as string = ";PSPad user HighLighter definition file"+ $CRLF + _
"[Settings]"+ $CRLF + _
"Name=THINBASIC"+ $CRLF + _
"HTMLGroup=0"+ $CRLF + _
"Label=0"+ $CRLF + _
"FileType=*.tbasic"+ $CRLF + _
"CommentString="+ $CRLF + _
"REMComment=1"+ $CRLF + _
"SinglQComment=1"+ $CRLF + _
"Preprocessors=1"+ $CRLF + _
"IndentChar="+ $CRLF + _
"UnIndentChar="+ $CRLF + _
"TabWidth=0"+ $CRLF + _
"DoubleQuote=1"+ $CRLF + _
"KeyWordChars=_$%"+ $CRLF + _
"CodeExplorer=ftVBS"+ $CRLF + _
"[KeyWords]"+ $CRLF + _
DIM sKeys AS STRING
DIM aKeys() AS STRING
DIM nKeys AS LONG
DIM Count AS LONG
'---Get a string with keywords separated by $TAB
sKeys = APP_ListKeywords
'---Parse string into an array
PARSE sKeys, aKeys, $TAB
'---Creates output buffer
nKeys = UBOUND(aKeys(1))
FOR Count = 1 TO nKeys
IF aKeys(Count) <> "REM" THEN
iniOut += aKeys(Count)+"=" + $CRLF
END IF
NEXT
iniOut += "[ReservedWords]"
'---Get a string with keywords separated by $TAB
sKeys = APP_ListEquates
'---Parse string into an array
PARSE sKeys, aKeys, $TAB
'---Creates output buffer
nKeys = UBOUND(aKeys(1))
FOR Count = 1 TO nKeys
iniOut += aKeys(Count)+"=" + $CRLF
NEXT
iniOut += "[KeyWords2]"+$CRLF+"[KeyWords3]"
file_save("ThinBasic.ini", iniOut)
[/code]
Optional: Start PSPad, go to Settings/User higlighter and select this file.
Dialog will appear, just hit "SAVE" button.
Step #3: Adding filter
You will find Documents/<userName>/Application Data/PSPad/PSPad.ini and append the following to it (change things in bold to match your setup):
Also do not forget to set value of UserHighLighterName (5th row of ini file)[THINBASIC]
Filter=THINBASIC (*.tbasic)|*.tbasic
HLTabWidth=2
IndentChar=
UnIndentChar=
Comment=000080001FFFFFFF010
Identifier=1FFFFFFF1FFFFFFF000
Key=008040001FFFFFFF100
Key words 2=004080FF1FFFFFFF100
Key words 3=1FFFFFFF1FFFFFFF100
Label=000000FF1FFFFFFF000
Number=008000001FFFFFFF000
Preprocessor=008080001FFFFFFF010
Reserved Word=004000801FFFFFFF100
Space=008080001FFFFFFF000
String=000000FF1FFFFFFF000
Symbol=1FFFFFFF1FFFFFFF000
Compilator File=E:\util\thinBasic\thinBasic.exe
Compilator Param=%File%
Compilator LOG=
Compilator Run=E:\util\thinBasic\thinBasic.exe
Compilator Help=E:\util\thinBasic\Help\thinBasic.chm
Compilator SaveAll=0
Compilator ParsLog=
Compilator Capture=1
Compilator HideOutput=0
Compilator DefaultDir=
Compilator LogType=0
Now you are finished. Just open tBasic files, and they will be highlighted correctly.UserHighLighterName=ThinBasic
Ctrl+Shift+E brings you to code explorer, which allows you to navigate through Functions and Subs.
To run scripts, use Ctrl+F9.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Thanks a lot Petr.
I have PSPad installed since many year and I can say it does its job.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Thanks a lot Petr, i just installed it and it looks good.
But I have 2 problems:
-I can't run my Thinbasic scripts, although the path is correct in the .INI file
-I don't like that vertical line at ruler position 80, is there a way to delete this line?
Still I hope that ThinAir problems will be solved soon, as I fall a little in love with this tiny editor. And I really hope that a scrollbar will be added in the Functions-combobox.
Be sure to have "Compilator Param=%File%" setup. See red line below.-I can't run my Thinbasic scripts, although the path is correct in the .INI file
Also check full path to thinBasic.exe executable. It must be where you have installed thinBasic, usually c:\thiBasic\thinBasic.exe
[THINBASIC]
Filter=THINBASIC (*.tbasic)|*.tbasic
HLTabWidth=2
IndentChar=
UnIndentChar=
Comment=000080001FFFFFFF010
Identifier=1FFFFFFF1FFFFFFF000
Key=008040001FFFFFFF100
Key words 2=004080FF1FFFFFFF100
Key words 3=1FFFFFFF1FFFFFFF100
Label=000000FF1FFFFFFF000
Number=008000001FFFFFFF000
Preprocessor=008080001FFFFFFF010
Reserved Word=004000801FFFFFFF100
Space=008080001FFFFFFF000
String=000000FF1FFFFFFF000
Symbol=1FFFFFFF1FFFFFFF000
Compilator File=E:\util\thinBasic\thinBasic.exe
Compilator Param=%File%
Compilator LOG=
Compilator Run=
Compilator Help=E:\util\thinBasic\Help\thinBasic.chm
Compilator SaveAll=0
Compilator ParsLog=
Compilator Capture=1
Compilator HideOutput=0
Compilator DefaultDir=
Compilator LogType=0
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Hi Martin,
that is weird. Does the syntax highlighting work ok for you at least?
What is the path of your ThinBASIC, does it contain spaces?
Petr
P.S. I also hope Roberto will become enthusiastic again.
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Removing vertical line at position 80 is ~easy:
- From menu choose "Settings / Program Settings"
- Choose "Editor (part 2)"
- Change number in "Position of Right Edge" to 1024
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Petr:
I also am having the same problem as Martin with PSpad.
Everything seems to be set up correctly according to your instructions, however, I am unable to get CTRL+F9 to start a run.
Don
XPS 1710
Hi Petr,Originally Posted by Petr Schreiber
I am 100% sure that I spelled the corred path (no spaces in it). The syntax highlighting didn't work after copying the INI files. I configured everything via the menu.
I will take a look again today to see what's wrong
Martin
Maybe the Ini file is in the wrong location.
Don, Martin,
when you select File/Open, can you see THINBASIC (*.tBasic) as an option (last) in the file types box? If not, check if your [THINBASIC] section is still in the PSPad.ini.
In case you edited it while PSPad was running, it is possible it got deleted on the exit of program.
Could you post your PSPad.ini file here?
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Bookmarks