Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Re-Dim (*solved*)
#5
Code:
DIM grid (4) as uByte => {0,1,2,3,4}
gridcopy=grid
Cannot assign an array to an escalar variable

Hmm.

Okay. If I dim gridcopy first, that bit works - but

1> It fails to copy the data. the first print out of gridcopy still shows 0,0,0,0
2> It fails to compile at the second copy, when I try to reinitialise it again: 40: Array 'grid' has 1 dimensions, not 0

Code:
DIM grid (4) as uByte => {0,1,2,3,4}
DIM gridcopy(4) as uByte

gridcopy=grid

ink 1
for n=0 to 4
print grid (n);" ";
next n

print
print

ink 2
for n=0 to 4
print gridcopy (n);" ";
next n

print
print

gridcopy(0)=10
gridcopy(1)=20
gridcopy(2)=30
gridcopy(3)=40

ink 1
for n=0 to 4
print grid (n);" ";
next n

print
print

ink 2
for n=0 to 4
print gridcopy (n);" ";
next n

gridcopy=grid

print
print

ink 1
for n=0 to 4
print grid (n);" ";
next n

print
print

ink 2
for n=0 to 4
print gridcopy (n);" ";
next n
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)