Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined GLOBAL label error on array (solved)
#1
Bug 
Hi,
Recently started experimented with the compiler. It's been great so far but I've just started getting unexpected errors using arrays. Compiling the snippet below results in:
test.bas:55: error: Undefined GLOBAL label '._myArray'.  
I can't see why this is failing ?  Am I doing something stupid ?  
I've used 1.14.1 and the latest state of the repo. Is it a bug ?

DIM myArray(1 to 6) as ubyte

SUB Init(byval num as ubyte)
    DIM i as ubyte
    FOR i=1 TO num
        myArray(i) = 0
    NEXT i
END SUB

Init(6)



Jonathan
Reply
#2
(03-27-2021, 03:12 PM)short_jonny Wrote: Hi,
Recently started experimented with the compiler. It's been great so far but I've just started getting unexpected errors using arrays. Compiling the snippet below results in:
test.bas:55: error: Undefined GLOBAL label '._myArray'.  
I can't see why this is failing ?  Am I doing something stupid ?  
I've used 1.14.1 and the latest state of the repo. Is it a bug ?

DIM myArray(1 to 6) as ubyte

SUB Init(byval num as ubyte)
    DIM i as ubyte
    FOR i=1 TO num
        myArray(i) = 0
    NEXT i
END SUB

Init(6)



Jonathan

This is a bug.
I'll post a fix soon. Thanks for reporting!
Reply
#3
Ok, try this build and tell me if it works, please Rolleyes

http://www.boriel.com/files/zxb/zxbasic-...a14.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...beta14.zip
http://www.boriel.com/files/zxb/zxbasic-...-win32.zip
http://www.boriel.com/files/zxb/zxbasic-...x64.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...cos.tar.gz
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)