Delete an Array Entry?

Dave dave at looktowindward.com
Thu Mar 1 09:10:52 EST 2007


Hi,

Please see text from the RunRev 2.8.x Dictionary copied below. Is the  
line:

  delete global myArray[17] -- removes 17th element of that array

Correct? Does it remove the 17th element, rather the element with the  
Key that is "17" ?

Thanks a lot
All the Best
Dave


delete local tempVariable
delete global myArray[17] -- removes 17th element of that array

Description:
Use the delete variable command to free memory used by a large  
variable, or to clean up after using many variable names.

Parameters:
The variableName is the name of any local or global variable.

The arrayIndex is a key of an array variable. If an arrayIndex is  
specified instead of a variable name, the delete variable command  
removes that element of the array, without deleting the rest of the  
elements in the array.

Comments:
If you use the delete variable form, the variableName, global or  
local, is deleted.

The delete variable command not only removes the contents of the  
variable, but deletes it entirely from memory. If you delete a key  
from an array variable, that element of the array no longer exists as  
part of the variable.

   Note:  Local variables that are used within a handler are  
automatically deleted when the handler in which they are used exits.





More information about the use-livecode mailing list