Results 1 to 4 of 4

Thread: Dimensioning variables not working as described in help file...

  1. #1
    Junior Member
    Join Date
    Dec 2023
    Posts
    21
    Rep Power
    4

    Dimensioning variables not working as described in help file...

    In the help file entry for DIM, it states...
    ---
    Alternatively, variables can be declared using prefix data type:

    {Variable Type} [scope modifier] VarName[(subscripts)] [AT Address] [ {VALUE | = | VALUE =} InitialValue ]

    Where:
    ·Variable Type can be any of the primary variable types supported by thinBasic:
    BYTE, INTEGER, WORD, DWORD, LONG, QUAD, SINGLE, DOUBLE, EXT, CURRENCY, STRING, ASCIIZ, VARIANT, GUID, NUMBER
    ·Scope modifier can be: LOCAL (default), GLOBAL, STATIC
    ---

    Any idea why my test program fails to dimension temp3 and temp4 ? ...


    'These work OK...
    string temp1
    Long temp2

    'Not working...
    String global temp3
    Long Static temp4


    VariablesTest.tbasic.LastRunTimeError.ini
    [Script]
    Main=C:\Users\Zamboni\Documents\TB\VariablesTest.tbasic
    Include=
    [RunTimeError]
    DateTime=25/06/2025 16:53:40
    Code=85
    Description=Something is incorrect. A keyword was not supposed to be present in the current position.
    Line=6
    LineCode=STRING GLOBAL TEMP3
    Token=TEMP2
    Additional=

  2. #2
    Junior Member
    Join Date
    Jan 2020
    Location
    France
    Posts
    12
    Rep Power
    7

    syntax working

    Quote Originally Posted by TheInsider View Post
    In the help file entry for DIM, it states...
    ---
    Alternatively, variables can be declared using prefix data type:

    {Variable Type} [scope modifier] VarName[(subscripts)] [AT Address] [ {VALUE | = | VALUE =} InitialValue ]

    Where:
    ·Variable Type can be any of the primary variable types supported by thinBasic:
    BYTE, INTEGER, WORD, DWORD, LONG, QUAD, SINGLE, DOUBLE, EXT, CURRENCY, STRING, ASCIIZ, VARIANT, GUID, NUMBER
    ·Scope modifier can be: LOCAL (default), GLOBAL, STATIC
    ---

    Any idea why my test program fails to dimension temp3 and temp4 ? ...


    'These work OK...
    string temp1
    Long temp2

    'Not working...
    String global temp3
    Long Static temp4


    VariablesTest.tbasic.LastRunTimeError.ini
    [Script]
    Main=C:\Users\Zamboni\Documents\TB\VariablesTest.tbasic
    Include=
    [RunTimeError]
    DateTime=25/06/2025 16:53:40
    Code=85
    Description=Something is incorrect. A keyword was not supposed to be present in the current position.
    Line=6
    LineCode=STRING GLOBAL TEMP3
    Token=TEMP2
    Additional=


    Try this syntax
    global temp3 as String 
    
    Static temp4 as Long
    

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    58
    Posts
    8,849
    Rep Power
    10
    Will check and let you know
    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

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    58
    Posts
    8,849
    Rep Power
    10
    Fixed: was a parsing bug described in help but not activated during parsing.
    Will be present in next 1.14.x update

    Thanks for reporting
    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

Similar Threads

  1. unique udt-variables
    By ReneMiner in forum Suggestions/Ideas discussions
    Replies: 2
    Last Post: 13-02-2016, 14:30
  2. Do you know: STATIC variables
    By ErosOlmi in forum Do you know ...
    Replies: 5
    Last Post: 05-08-2008, 11:03
  3. global variables
    By sandyrepope in forum UI (User Interface)
    Replies: 1
    Last Post: 06-03-2007, 19:16
  4. Some not working examples in help file
    By Petr Schreiber in forum Fixed or cleared errors in help material
    Replies: 1
    Last Post: 06-09-2005, 14:50

Members who have read this thread: 7

Posting Permissions

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