Statement: mark
Unless directed otherwise, the program will remember all variables and defined entities, even after the script has finished running. The statement mark is used to control this behaviour.
Entity definitions (function, command and object) are added to the library as they are encountered in the script. This can be particularly problematic when testing a new script. We may want to make small change and re-run the script. Without using 'mark', it would try to add another copy of the entity which would result in an error.
Format | Example |
---|---|
mark tag; | mark start_test; |
When processing the mark statement, if the tag is already in use then all entity definitions (and variables) added after that tag are removed. The mark tag itself is not remove but any mark tags added afterwards are.
Values that are changed with the set statement and that have been set after the mark statement are reset to their previous values.