Blitzarrays

Archives Forums/Blitz3D Bug Reports/Blitzarrays

Silver_Knee(Posted 2010) [#1]
I love them:

Data 0,0,0,0
Data 0,0,0,4
Data 0,0,0,8
Data 0,0,0,12
Data 0,0,0,16



Local a[4]
Read a
For count=0 To 4
	Print a[count]
Next
WaitKey


or try

Local a[10]
Print Str(a)
End


:)


GIB3D(Posted 2010) [#2]
How is that a bug?


Floyd(Posted 2010) [#3]
It's a bug because the array is misused but Blitz3D doesn't catch the error.

Data 5
Local a[0]
Read a		; wrong, but compiler doesn't notice
a = 5		; similar error does get caught



PowerPC603(Posted 2010) [#4]

Data 0,0,0,0
Data 0,0,0,4
Data 0,0,0,8
Data 0,0,0,12
Data 0,0,0,16



Local a[4]
Read a
For count=0 To 4
Print a[count]
Next
WaitKey



This gives me very strange numbers (but no error):
9961472
35788945
1
31
29426952

The big numbers are different each time, except the "1" and "31", they stay the same.




Local a[10]
Print Str(a)
End



This gives me MAV on the "Print Str(a)" line (v1.98).


Silver_Knee(Posted 2010) [#5]
i think the Data-thing just reads any memory. got an 1 and a 31, too.

Str() normally ignores type-converting errors for:

t.mytype=New mytype
t\lol=3
t\haha$="cool"

Print str(t);Prints [3,"cool"]