Error when setting array elements by a pointer
Posted: Tue Mar 14, 2017 4:29 pm
Hello,
The following SB code does not define the PB internal pointer properly:
Produces the error: TypeError: a.view is undefined
The slightly modified code in PB works fine:
Erion
The following SB code does not define the PB internal pointer properly:
Code: Select all
Global i
Dim S.l(2)
Global *Sp = @S()
PokeL(*Sp, 0, 42)
PokeL(*Sp, 1, 1984)
PokeL(*Sp, 2, 2012)
For i = 0 To 2
debug s(i)
Next
The slightly modified code in PB works fine:
Code: Select all
Global i
Dim S.l(2)
Global *Sp = @S()
PokeL(*Sp, 42)
*sp+SizeOf(long)
PokeL(*Sp, 1984)
*sp+SizeOf(long)
PokeL(*Sp, 2012)
For i = 0 To 2
Debug s(i)
Next