SetContextStatus command

Used in a Server.Load script to set the context iteration status.

Controls execution of parts of the script that are not executed every time the script is run, but are executed every Nth time through the script. SetContextStatus reads the value of ContextIterationN= from the NOTES.INI. This sets a condition that on the Nth iteration of the script, a command placed in an @IF statementwith that N value will be run.

Syntax

SetContextStatus <contextvariable>

Where contextvariable indicates which NOTES.INI ContextIteration variable to reference for an @IF test.

The NOTES.INI is read for a "ContextIterationX" value, where X is a positive number. This is used in conjunction with an @if test that should follow it. There can be a MAXIMUM of 10 ContextIteration variables. In the following example, @IF [@1] will check if this iteration is a multiple of what was listed in the ini (ContextIteration1=12 for ex., so every 12th iteration) and if true then it is time to do this operation, then the code from here to the first @ENDIF encountered will be executed. For example:

Set in the NOTES.INI:

ContextIteration1=12

Set in the script:

SetContextStatus 1
@if[@1]
pause 30 sec
@endif

Here, it sets the variable "1", set by ContextIteration1 to be 10.

SetContextStatus sets that value as an iteration value to check. In this case then, every 10th iteration of the script this @if will be true and the pause will be executed.

This is to get around a single nthiteration variable (different commands need different intervals at which to be executed).