[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re-DIM a variable "on the fly" ??



Hi,

I got the gate editor to work on my logic gate simulator.

If you choose to add a gate I need to make a variable array
larger

example
s=8
DIM X(s)

NEW GATE:
s=s+1:REM s=9
X(s)=5

!!ILLEGAL QUANTITY ERROR!!
X is only dimmed for 8, and I want to add a 9th variable.

My work around:

Always DIM X to s+1
DIM X(s+1)

when you add a variable, make X(s+1)equal to that value,
SAVE the DATA, and LOAD it again.  The DATA is dimmed
to s+1 each time it is LOADed, so I can add one more
varaiable AGAIN before I have to SAVE/LOAD again.

This takes alot of time!  Add 1 gate and the disk spins
for a while.  SAVE/LOAD.

Ideas for a fix?

Rich