07-12-2011, 06:48 PM
oblo Wrote:Thanks but still the sameI'm using the last version (1.2.8 ) Now, I'm trying to reduce the code defining uByte variables and arrays but it seems I don't know the syntax because I'm getting the error Syntax Error. Unexpected token 'AS' <AS>. I'm trying to it in several ways do:
Code:10 LET a=1 AS INTEGER
20 LET b=1 AS INTEGER UBYTE
30 LET c=1 AS UBYTE
Please tell me the correct way to do it. If after it the program still fails, it won't be a problem for me to sent it to you. I'm sure I can learn a thing or two about this
Cheers
You have to declare the variables *before* they are used. If you don't the compiler will try to "guess" the most suitable type. To declare a variable use DIM:
Code:
REM Line numbers are not needed
DIM a As Integer
DIM b as Ubyte
DIM c as Ubyte
10 LET a=1
20 LET b=1
30 LET c=1
Read here for more info: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Syntax">http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Syntax</a><!-- m -->