The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




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)