labelizeformula(
labelizeformula(
FORMULA
,
PATTERN
)

The labelizeformula( function returns the value of a formula along with the formula itself as a label.

Parameters

This function has two parameters:

formula – is the text of the formula, which must be quoted.

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 formula along with the formula itself as a label. This saves having to type the formula twice when you need to display a formula when logging and debugging, for example in a zlog statement. If you don’t specify a pattern, the output will be the formula (the label), followed by `-->`, followed by the value calculated by the formula, as shown by these examples.

    labelizeformula({2+2}) ☞ 2+2 --> 4
    labelizeformula({info("databasename")}) ☞ info("databasename") --> Contacts
    labelizeformula({upper("Name")}) ☞  upper("Name") --> ROBERT

If the formula result contains more than one line, a different default pattern is used. For example, the info(“files”) function will return a multiline list of open databases. So the formula:

    labelizeformula({info("files")})

will return a result like this:

    === info("files") ============
    Contacts
    Orders
    Products
    === END OF info("files") ============

### 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.

    labelizeformula({upper(City)},"«label» >>>«value»<<<") ☞ upper(City) >>>FRESNO <<<

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

    labelizeformula({upper(City)},"><") ☞ upper(City) -->FRESNO <--

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

    "«label» --> «value»"

and

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

for multi-line values.

See Also

- Client/Server Debug Instrumentation -- using instrumentation with Panorama X server and clients.
- Debug Instrumentation -- conditional logging of the internal state of Panorama program code.
- info("runningunderterminal") -- returns true if Panorama was launched under Terminal.app.
- labelize( -- 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.
- labelizeinfo( -- returns the value of an info( function, along with the function itself as a label.
- labelizepattern( -- formats a text value using a label and a pattern.
- message -- displays a modal alert window with a message.
- nsnotify -- delivers a notification.
- stdout -- sends one or more characters to standard output.
- zlog -- outputs a message to the instrumentation log (if instrumentation is enabled).
- zlogalways -- unconditionally outputs a message to the instrumentation log.
- zlogcoverage -- allows instrumentation coverage to be turned on or off within a procedure.
- zlogdictionary -- outputs a data dictionary to the instrumentation log (if instrumentation is enabled).
- zlogging( -- returns true if zlogging is enabled for the current database and procedure, otherwise false.

History

Version | Status | Notes
10.2 | New | New in this version.