
Originally Posted by
TheInsider
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