Cant read labels in functions ?

BlitzMax Forums/BlitzMax Beginners Area/Cant read labels in functions ?

Could this be a possible bug ?
test()

Function test()

RestoreData mydata

For a = 1 To 5
	ReadData info
	Print info
Next

#mydata
DefData 2, 4, 6, 8, 10
End Function

I get this error - "Compile Error:Label 'mydata' not found"

hmm.. dunno. I'd suggest using incbin anyway, and reading from the file. Data is pretty obsolete now.

Looks like it...

I'm sure you've already tried this, but simply moving the data outside of the the function into the main program will make it work:

test()

Function test()

RestoreData mydata 

For a = 1 To 5 
     ReadData info
     Print info 
Next

End Function 

#mydata
DefData 2, 4, 6, 8, 10


Why would you want your DefData inside a function anyway?