The *delete command enables the complete removal of any variable from a game, and at any point during the game. It can be applied to both temporary (*temp) variables or permanent ones (defined using the *create command in startup.txt).
A typical example of use might be conditional, as follows:
*temp var 100 *if var > 99 *delete var
Any attempt to reference a deleted variable later in the game will result in a "Non-existent variable" error.
Generally speaking, it's not used very much at all except perhaps to (fairly needlessly) 'tidy up' unwanted variables once they have served their purpose. In particular, bear in mind that all *temp variables are automatically removed from memory with each loading of a new scene file.
Origin and purpose
The *delete command is believed to be one of the original commands available in the very first version of ChoiceScript, and which to date has simply never been removed. However, you won't find it listed in any official Helpfiles so its actual purpose remains a mystery, as it no longer appears to serve a practical purpose (who wants to generate even more errors in their game?).
It has been speculated that *delete may originally have served some sort of debugging purpose, with more recent versions of ChoiceScript having since rendered the command more or less obsolete.
We would welcome discussion on the subject in the Comments section below - especially if you have used, or have seen examples of use, where *delete serves a purpose of some value to other authors.
|Choice||*choice, *fake_choice, *disable_reuse, *hide_reuse, *allow_reuse, *selectable_if|
|Variable||*create, *temp, *set, Arithmetic operators, *delete, *input_number, *input_text, *print, *rand|
|Conditional||*if, *elseif, *else|
|Goto||*label, *goto, *goto_scene, *goto_random_scene, *gosub, *gosub_scene, *finish|
|Formatting||Bold text, Italic text, *image, *line_break, *page_break, *link, *stat_chart|
|Miscellaneous||*comment, *scene_list, *title, *author, *achieve, *achievement, *check_achievements, *bug, *ending, *more_games, *share_this_game, *show_password, *script|