New

Posted on April 15, 2013

Here

Posted on April 8, 2013

As most of those who have built “F” codes know, there are three levels in the stack. Sometimes a forth level is needed. This is particularly true when using the string extract code “[]”. A “feature” of code processing is that value-marks can be used to separate command statements.
Suppose that you need to examine the last character in a string for a numeric value. If it’s numeric then report that value, else report nothing. Attribute 5 is tested in the following example.

TEST.LAST.CHAR

001 S
002 0
003 NBR
008 F;5;(L0)}F;5;LPV;”1”;[];(P(1N))
009 R
010 3

The character “}” following the “(L0)” string is a value mark. The “LPV” returns the result of the prior command. The “[]” extract function expects to find the string in Stack 3, the start position in Stack 2 and the length in Stack 1. “Wishing for a Stack 4” is due to the length of the string function needed to “load” Stack 1. If the length of string function (L0) was included in a single value command sequence, then it would have “pushed” a needed data value off the stack – “into Stack 4”. Therefore a multi-value sequence was needed.

Of interest – the commands separated by value-marks can be any valid correlative or conversion code. In other words, you can combine “F” codes with “A” codes with… you get the idea.

Using the above example – suppose that the results needed to be concatenated to the end of the data value in attribute 6.
Then attribute 8 in the dictionary item is:
008 F;5;(L0)}F;5;LPV;”1”;[];(P(1N))}A;6:(LPV)
The character “}” preceding the “A” is a second value mark.