labelizeinfo(
OPTION
,
PATTERN
)

The labelizeinfo( function returns the value of an info( function, along with the function itself as a label.


Parameters

This function has two parameters:

option – is the info( function option.

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 an info( function along with the info function itself as a label. This saves having to type the function twice when you need to display a function 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.

labelizeinfo("databasename") ☞ info("databasename") --> Products
labelizeinfo("computername") ☞ info("computername") --> Bob's MacBook Pro 
labelizeinfo("dialogtrigger") ☞ info("dialogtrigger") --> Cancel

If the function result contains more than one line, a different default pattern is used. For example, the formula:

labelizeinfo("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 database name has an extra space on the end.

labelizeinfo("databasename","«label» >>>«value»<<<") ☞ info("databasename") >>>Products <<<

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

labelizeinfo("databasename","><") ☞ info("databasename") -->Products <--

Note: The default patterns built into the labelizeinfo( 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.