labelize(
NAME
,
PATTERN
)

The labelize( function returns the value of a field or variable along with a label. This saves typing when you need to display fields or variables when logging and debugging.


Parameters

This function has two parameters:

name – is the name of the field or variable. This may be quoted or not quoted, Panorama will figure it out.

pattern – is the pattern that will be used. If this parameter is omitted, a default pattern will be used (see below).


Description

This function returns the value of a field or variable along with a label. This saves having to type the field or variable name twice when you need to display a field or variable when logging and debugging, for example in a zlog statement. If you don’t specify a pattern, the output will be the name of the field or variable (the label), a colon and a space, followed by the value contained in the field or variable, as shown by these examples.

labelize(Name) ☞ Name: John Doe
labelize(City) ☞ City: San Francisco
labelize(Price) ☞ Price: 4.95

If the field or variable contains more than one line, a different default pattern is used. Suppose you have a field named Full Address that contains an entire address. In that situation, the formula:

labelize(«Full Address»)

will return a result like this:

=== Full Address ============
8120 Flagstaff Avenue
Tuscon, AZ 91029
=== END OF Full Address ============

Custom Patterns

If the standard pattern doesn’t meet your needs, you can add a second parameter to supply your own custom pattern. This pattern must contain «label» where you want the label to appear, and «value» where you want the value to appear. Here’s an example where using a custom pattern reveals that the city name has an extra space on the end.

labelize(City,"«label» >>>«value»<<<") ☞ City >>>San Luis Obispo <<<

This is such a common situation that there is a special shortcut pattern set up for this situation, ><.

labelize(City,"><") ☞ City -->San Luis Obispo <--

Note: The default patterns built into the labelize( function are:

"«label»: «value»"

and

"=== «label» ============"+cr()+"«value»"+cr()+"=== END OF «label» ============"

for multi-line values.


See Also


History

VersionStatusNotes
10.2NewNew in this version.