Way to [re]initialize an array

May 20, 2008
9,199
60
Syracuse, NY, USA
... regardless of dimensions ...

maybe "FILLARRAY <array_name> <string>

Also, "SETARRAY /0 ..." might initialize all entries to "0" when it's created.
 
May 20, 2008
9,199
60
Syracuse, NY, USA
What's wrong with unsetting and redefining it?
I don't just want to [re]define it. I want to [re]initialize it with data.

Code:
setarray [/f] /0 a[%len,2]
would be a lot easier than
Code:
setarray [/f] a[%len,2]
do i=0 to %@dec[%len] ( do j=0 to 1 ( set a[%i,%j]=0 ) )
 
  • Like
Reactions: rps

rps

Jul 6, 2008
387
4
I don't use arrays that often, but when I do your suggestions would be helpful.

IMHO, this addition would also make the code easier to understood.