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
- Client/Server Debug Instrumentation -- using instrumentation with Panorama X server and clients.
- Coding with Debug Instrumentation -- modifying your code to generate debug instrumentation output.
- Crash Proof Debug Instrumentation Monitoring -- real time crash-proof instrumentation monitoring
- Customizing Debug Instrumentation Coverage -- specifying what code is being debugged at the moment.
- Debug Instrumentation -- conditional logging of the internal state of Panorama program code.
- Debug Instrumentation Log Window -- dynamically monitor debug instrumentation output as your program runs.
- Debug Instrumentation Monitoring using an External Program -- monitoring debug instrumentation with an external program (Terminal.app, BBEdit.app).
- Debug Instrumentation Text File -- configuring and accessing the debug instrumentation log (text) file.
- info("runningunderterminal") -- returns the name of the terminal program if Panorama was launched under one, otherwise it returns empty text.
- labelizeformula( -- returns the value of a formula along with the formula itself as a label.
- 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.
- Recording Code Triggers in Debug Instrumentation -- the code triggers option automatically tracks whenever any code is triggered, whether from a menu, a button, or implicitly (for example when data is entered).
- Recording Control Flow in Debug Instrumentation -- configure debug instrumentation to automatically log when control flow is non-linear, for example a call, return, goto, etc.
- setzlog -- turns instrumentation coverage on or off for a specific procedure (or all procedures within a database).
- 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
10.2 | New | New in this version. |