CHANGED
Checks to see if a variable has changed during processing. The variable is compared to its value at the last time CHANGED was invoked. The first call that is non-blank or non-zero will always return TRUE.
Note: Each copy of the CHANGED function keeps its own last value. They will be independent of other copies.
Note: Any embedded NULL characters will stop the comparison. For example, if a variable has the
value ABC(null)DEF initially and then ABC(null)XYZ in the next document, the CHANGED function
will report an equal condition because only ABC is evaluated in each variable. CHANGED is a
STRING comparison. To work with this situation, an IF structure should be used.
Syntax
CHANGED(varname)
Arguments
Argument | Description | Default |
---|---|---|
varname | The variable name to be checked to see if it has changed. | None |
Results
Result | Description |
---|---|
Return |
TRUE (1) if changed, otherwise FALSE (0). Note: Since CHANGED returns a Boolean operator (TRUE or FALSE), you can use it within an IF instruction. For example,
IF CHANGED(%%var) THEN... . |
%%RC | Always 0. |
%%RM | A null string (''). |
%%RV | Always 0. |
Examples
Function Call | Return | %%RC |
---|---|---|
The previous and current value for |
0 | 0 |