Context - Add/Remove Points from the Context
point = Context ( point point ... ) | |
point = ContextL ( point point... ) |
point | The point (or points) to be added to the current context. The last point is returned as the value. |
The Context module adds the specified point(s) to the context, replacing any other point of the same dimension. The difference between Context and ContextL is that Context adds the point to the closest permanent frame, while ContextL adds the point to the local frame.
A potential source of problems with the Context module is when it is invoked in a nested module situation. For instance
Enum( dim.. "@ Do(..." "Context( [NewPoint dim*] )" ". . ." |
where [NewPoint dim*] evaluates to a point on dim other than the context point. Here we are attempting to update the context with a point that is already on the context and being updated as part of the Enum module. In these cases V4 will generate an error and the ContextL module should be used.
If all the points in a list are to be added to the context, use Context(`list).
Context( Cus:1234 ) | Adds Customer 1234 to the current context. |
Counter - Creates, Updates and Tests Internal Counters
result = Counter ( tagarg ) | |
result = Counter ( Reset:counter value ) |
result | The result is based on the tagged argument. | |
tagarg | One of the tagged arguments below. |
Count::name | Returns the current value of counter name. No change is made to the counter. | |
First::name | Returns Logical:True if this is the first runtime reference to counter name or Logical:False if it is not. Each time the counter is tested with this argument it is incremented. | |
Next::name | Increments and returns the incremented value of the counter as a point on Dim:Int. | |
Reset::name | If a second argument is not given then Resets the counter name to zero. A subsequent call with First will return Logical:True. | |
Reset::name | If a second argument is specified then the counter's internal value is set to the integer value of the second argument. |
This module allows the programmer to maintain any number of internal integer counters within V4. All counters are referenced with a name or number. A counter is automatically created and set to zero on its first call to this module. All counters are points on Dim:Int.
Counter(First::xxx) | returns True on the first call | |
Counter(First::xxx) | returns False after the first call | |
Counter(Next::xxx) | returns Int:3 as this is the third call | |
Counter(First::^p"V4(Unique?)") | returns True on the first call, False thereafter |