@ptr instruction

hello,
i try to write a simple one dimension array programm :

ptr = 1
let b2=0
for b1 = 1 to 4
put @ptrinc,b2
b2 = b2 +5

next b1
pause 100

for b1 = 4 to 1 step -1
get @ptrdec,b3


next b1

The main problem is the B3'values stay at 15...
 

Technical

Technical Support
Staff member
You don't normally use put/get and @ptr at the same time, this is very confusing.
What are you trying to achieve? Try either of these, which do the same.

Code:
let b2=0
for b1 = 1 to 4
put b1,b2
b2 = b2 +5
next b1

pause 100

for b1 = 4 to 1 step -1
get b1,b3
next b1
or

Code:
ptr = 1
for b1 = 1 to 4
@ptrinc = b2
b2 = b2 +5
next b1

pause 100

for b1 = 4 to 1 step -1
b3 = @ptrdec
next b1
 
Top