I
AUREL, That was interesting. I am glad you posted it. I will study it further when I have the time.
Texas Pete
Well it's an interesting run-around Aurel .. ;D .. but I think your working arrays are very real, and you need two of them to do the job .. :P
Here's the same thing worked directly with one dynamically sized array ..
DEF asize,y,run:INT
DEF w1:WINDOW
autodefine "off"
Window w1,0,0,500,450,@minbox,0,"Virtual Array",main
Setwindowcolor w1,rgb(220,220,230)
' set required array size including the zero element ..
asize = 10
' dynamic sizing ..
def a[asize]:int
' generate array values allowing for zero element ..
FOR n = 0 TO asize-1
a[n] = n + 2
NEXT n
GOSUB show_array
'--------------------------------------------------------
run=1
waituntil run=0
closewindow w1
end
'-------------------------------------------------------
Sub main
Select @class
Case @idclosewindow
run=0
Case @idcreate
Centerwindow w1
Endselect
Return
'------------------------------------------------------
SUB show_array
FOR n = 0 TO asize-1
y = y + 30
Move w1,10,y : PRINT w1,"a[" + str$(n) + "] = ", a[n]
NEXT n
RETURN
best wishes, :)
Graham