DYO: IF( GV[1], #, Value) explained


Q:  I would just like to understand the SET-RESET mechanism whether it is used for any purpose.   To generalize, let us say line D finds a TRUE CONDITION x of any kind.  And, I suppose line F finds that that condition is now FALSE.   Why does Line I reset that condition?

A:  The statement in question is:    IF( GV[1],  #,  Value)

The IF statement tests a Boolean flag and this flag is the 1st parameter which is the content of  GV [1].

IF the flag is True, the statement Reads/Returns the 2nd parameter, which is the content of the number field.

If the flag is False, the statement Reads/Returns the 3rd parameter, which is the content of Value, which is the Read GV reference.

The value read, which is either the # or the Value, is then written to the Write GV referenced.

The SET mechanism was to return a 1 value when True, and write this 1 into GV [250].   If the statement was false, the content of [250] was read and written right back out, which means [250] did not change when the flag was false.

The RESET mechanism was to return a 0 value when True, and write this 0 into [250].   When False, the content of [250] was read and rewritten, so it did not change.

So in summary, the statement is one way to conditionally assign a new value to a GV when True, and leave the GV content alone when False.

Last modified 12/14/07 1:29 PM