Page 1 of 1

Clear for fast clearing variables

Posted: Fri Aug 27, 2021 10:50 pm
by jacdelad
Hello,
I'd like to see a new command, Clear. I know this from other languages, used for fast clearing a bunch of variables at once:

Code: Select all

Define first.s,second$,third.l,fourth.i,NewList MyList.s(),NewMap MyMap.l()
;Do stuff and fill variables, lists, etc.
Clear first,second$,third,fourth,MyList(),MyMap()
...would set strings to length 0, all other variables to 0, lists and maps emptied.

Just a suggestion...

Re: Clear for fast clearing variables

Posted: Sat Aug 28, 2021 12:22 am
by BarryG
jacdelad wrote: Fri Aug 27, 2021 10:50 pmwould set strings to length 0, all other variables to 0, lists and maps emptied

Code: Select all

first=0 : second$="" : FreeList(MyList()) : FreeMap(MyMap()) ...
Why not just do this?

Re: Clear for fast clearing variables

Posted: Sat Aug 28, 2021 12:50 am
by jacdelad
Yes, I could. But I don't want to. Clear would be a bit handier.