Forum
Array FLOAT only works if global (solved) - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Bug Reports (https://www.boriel.com/forum/forumdisplay.php?fid=15)
+---- Thread: Array FLOAT only works if global (solved) (/showthread.php?tid=2505)



Array FLOAT only works if global (solved) - zarsoft - 11-14-2023

This program only works if the array is global.

Is this supose to work like this?

Code:
SUB Test
DIM T(3) AS FLOAT => {0.5,1.5,2.5,3.5}

PRINT
FOR i = 0 TO 3
  PRINT "T(";i;")= ";T(i)
NEXT i 

T(0) = 0.5
T(1) = 1.5
T(2) = 2.5
T(3) = 3.5

PRINT
FOR i = 1 TO 3
  PRINT "T(";i;")= ";T(i)
NEXT i 

PAUSE 0
END SUB

Test



RE: Array is global - boriel - 11-14-2023

No. It should work also with local arrays.
I'll check it.


RE: Array is global - zarsoft - 11-14-2023

Works with LONG but does not work with FLOAT.


RE: Array is global - boriel - 11-24-2023

Try this beta and let me know if it works:
http://www.boriel.com/files/zxb/zxbasic-1.17.2-beta5.tar.gz
http://www.boriel.com/files/zxb/zxbasic-1.17.2-beta5.zip
http://www.boriel.com/files/zxb/zxbasic-1.17.2-beta5-win32.zip
http://www.boriel.com/files/zxb/zxbasic-1.17.2-beta5-linux64.tar.gz
http://www.boriel.com/files/zxb/zxbasic-1.17.2-beta5-macos.tar.gz


RE: Array is global - zarsoft - 11-25-2023

Works, thanks.