Please enable JavaScript to view this site.

A-Shell Development History

.CLEAR $ARY()

Similar to REDIMX $ARY() except it removes all of the elements of the (associative) array without deleting the array itself. This is particularly useful when working with PRIVATE arrays, since there is otherwise no practical way to destroy and recreate such arrays. And manually deleting all of the elements requires a two-step process, since you can't directly delete items as you iterate through them, since it corrupts the iterator.

Note that while A-Shell Basic also contains dot-variables and dot-functions, this is the first example of a "dot-statement". The dot prefix was mainly used to avoid conflict with existing use of variables named "CLEAR", but also suggests class-method functionality, which is how this operation would be implemented in most other (object-oriented) languages.

Also note: you need compiler version 638 or higher to compile this statement, and A-Shell version 6.1.1354 or higher to execute it, otherwise you'll get an illegal syntax code error.