Alter - Function SummarySummary:If a value is not found in a series, append it; otherwise, remove it. Usage:alter series value Arguments:series - The series argument. (must be: series port) value - The value argument. Description:The ALTER function is a type of data set operation. It either adds or removes a value depending on whether the value is already included. The word ALTER is short for the word "alternate". For example, let's say you want to keep track of a few options used by your code. The options may be: FLOUR, SUGAR, SALT, and PEPPER. The following code will create a new block (to hold the data set) and add to it:
You can use functions like FIND to test the presence of an option in the set:
If you use ALTER a second time for the same option word, it will be removed:
Normally ALTER values are symbolic words (such as those shown above) but any datatype can be used such as integers, strings, etc.
Related:difference - Return the difference of two data sets. User Comments:-From: giesse_writeme.com 7-Dec-2000/2:41:57-8:00: NOTE: it returns the head of the list when the value is appended, but returns the position after the removal if the value is removed.
| |||||
|