Special Flag Fields
|Special flags are available that cause the printer to automatically insert text into a field. These flags can be inserted anywhere in the text string. All flags begin with a percent sign “%” and are followed by an optional number and then a character.
The following flags are available for use. Note that the computer’s locale setting may affect the output of these flags, including language, order, etc.
|Flag Help Form
If you click the Flag Help button in the Text Field Editor form, the form shown below will appear, which provides help on the various flags that can be inserted into the message.
The left pane of the form shows a list of the flags that are available to you for insertion into your text field. When you select a flag, the right pane shows a preview sample of the text that will be generated by the flag. Some flags have optional parameters that you can specify as well. In the above exampe, the %C flag can have an optional number before the letter C that specifies the number of digits to put in the year portion of the generated text. In this example, you may specify 2 or 4 digits.
Once you have selected your flag and provided the optional parameter for it, you may click the Insert button. The form will close, and the selected flag will be inserted into your text message at the cursor.
Text field before using the Insert feature of the Flag Help form. Note the position of the cursor within the text. This is where the flag will be placed.
Text field after inserting the %4C flag from the Flag Help Form
|New in V1.90 is a string function processor that allows you to perform string, mathematical and logical operations on text fields or barcode contents.
The function evaluator provided in V1.90 and later of Producer is specifically designed for text string processing. All function arguments and results are text strings by their nature, although some functions interpret strings as numbers and some return results are numbers represented as strings.
Functions can be embedded anywhere within a text string, and upon evaluation, will be replaced by the result of the function computation. Any number of functions can be included in a single text field, and functions may be nested to any level.
Each function begins with a special sequence that identifies the start of a function. This sequence is the combination of a colon and an equal sign ":=". Immediately following this start sequence is the name of the function. All function names are followed by an argument list with zero or more arguments enclosed in parentheses.
For example, the "concat" function simply returns its argument list combined (or concatenated) as a single string as shown below (note that in all examples, double quotes enclose the strings for clarity only and are not required):
Notice that in all examples, the function is surrounded by text strings "ABC" and "DEF" that are copied directly to the output. In the first example, the arguments to the concat function are placed directly next to each other with no intervening space. This is because the second argument immediately follows the comma, which separates the arguments. The second example corrects this by placing a comma before the word "World".
The third example above produces the same same result as the second, but is perhaps more obvious since the space character is part of the argument to the second, nested concat function.
The fourth example also produces the desired result by using the anonymous function - simply leave off the function name - which is the same as the concat function.
Functions take zero or more arguments. Functions will ignore arguments beyond their required number, except for those functions that take an unlimited number of arguments.
Arguments are separated from each other by commas. Spaces within arguments are significant as shown in the examples above, unless the argument is itself a function call. For example, in a reworking of the third example above, the added spaces before the nested concat function call are ignored and not part of the output result:
If you don't supply the minimum number of arguments for a function, you will receive an error flag in the result text.
The function processor is designed to handle text strings, so all arguments are fundamentally just text. However, some functions treat text strings as numbers or logical values.
Each function returns a result that is a text string by nature. However, just like function arguments, return results may be interpreted as numbers or logical values depending on the function.
The return result of the outer level function is always embedded into the surrounding text, even if the return result is a null string (empty).
If you have an error in your formula, the processor will insert an error message into the result string. The error message begins and ends with an exclamation point. If the error is specific to a function, the function name will follow the first exclamation point. The type of error follows the function name.
The following functions are supported by Producer for both text and barcode fields:
Table of Contents
Copyright © 2010 InfoSight Corporation All Rights Reserved
InfoSight ® is a registered trademark of InfoSight Corporation