Results 1 to 10 of 16

Thread: Alternative IDE: PSPad

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Alternative IDE: PSPad

    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):
    [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
    Also do not forget to set value of UserHighLighterName (5th row of ini file)
    UserHighLighterName=ThinBasic
    Now you are finished. Just open tBasic files, and they will be highlighted correctly.
    Ctrl+Shift+E brings you to code explorer, which allows you to navigate through Functions and Subs.

    To run scripts, use Ctrl+F9.
    Attached Images Attached Images
    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

Similar Threads

  1. Alternative IDEs
    By ErosOlmi in forum Alternative IDEs
    Replies: 33
    Last Post: 19-07-2021, 07:43
  2. Alternative IDE: thinSED
    By José Roca in forum Alternative IDEs
    Replies: 31
    Last Post: 13-08-2011, 18:38
  3. ThinBasic... an alternative?
    By Polarwolf in forum Shout Box Area
    Replies: 12
    Last Post: 14-08-2008, 20:03

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •