HistoryCal - V0.0.7 Manual
mark & clear
Home Development V0.0.7 Manual Script mark & clear

mark & clear Statements

Unless directed otherwise, the program will remember all variables and defined entities, even after the script has finished running. The statements mark and clear are used to control this behaviour.

Entities definitions (function, scheme etc.) are added to the library as they are encountered in the script. This can be particularly problematic when testing a new script, when we may want to make small changes and re-run the script. Without using 'mark', it would try to add another copy of the entity which would result in an error.

Note that we control the removal of entities separately from the removal of variables.

FormatExample
mark tag; mark start_test;
clear; clear;
clear tag; clear start_test;

mark Statement

When processing the mark statement, if the tag is already in use then all entity definitions added after that tag are removed. The mark tag itself is not remove but any mark tags added afterwards are removed.

The default input and output schemes that have been set after the mark statement are reset to their original values.

Note that variable names are not removed with this statement. Use clear to remove the tag as well as all variables.

clear Statement

A clear statement by itself will remove all the current variables. It can be used at the beginning of a script to ensure we are starting with a clean slate. Or it can be used at the end to tidy up.

A clear statement with a tag is equivalent to a mark statement plus a plain clear statement and the mark statement will be removed as well.

In effect, the clear tag; statement will remove all traces of the script since, and including, the corresponding mark tag; statement.

Home Development V0.0.7 Manual Script mark & clear

Managed by WebPageLayout Validated by HTML Validator (based on Tidy)

12th October 2016