delete variable

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
delete {local | global | variable} {<variableName> | <arrayIndex>}
Synonymsclear variable
Summary

Removes a variable contents from memory.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
variableName

The name of any local or global variable.

arrayIndex

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.

Example
local tVariable
delete local tVariable
global gArray
delete global gArray[17]
RelatedKeyword: element
Command: global, delete, local
Function: globalNames
Glossary: key, handler, variable, exit, local variable, array, command
Description

Use the delete variable command to free memory used by a large variable. The delete variable command only removes the contents of the variable.

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.

Tagsproperties