Home > Contents > Index >
Expanded TOC   |    Accordion TOC   |    Annotated TOC   |    Index

 

ICS.ResolveVariables

Resolves any variable, built-in function, query column value, counter, or property embedded in an input string.

This method has the following two variants, both of which :


ICS.ResolveVariables

Resolves any variable, built-in function, query column value, counter, or property embedded in this string using the old replacement syntax.

Syntax

Parameters

str
The string that may have embedded variables.

Description

The ResolveVariables method resolves any variable, built-in function, query column value, counter, or property embedded in an input string. For example, if passed the following input string:

the method returns the following string:

The "old" replacement syntax causes occasional ambiguities. We recommend using Variant 2 instead, which uses the "new" replacement syntax.

Returns

A String in which the embedded variables are all resolved.

Example

The following Greeting string contains two embedded variables:

At runtime, sg looks similar to the following:


ICS.ResolveVariables

Resolves any variable, built-in function, query column value, counter, or property embedded in this string using the new replacement syntax.

Syntax

Parameters

str
The string that may have embedded variables.

new
Setting to true tells ResolveVariables to use the new replacement syntax. Setting to false tells ResolveVariables to use the old replacement syntax, as described in ResolveVariables (Variant 1) .

Description

This variant of ResolveVariables uses the new replacement syntax. We recommend using the new syntax rather than the old. This new syntax lets you specify parentheses to clarify the order of evaluation; thus, the syntax is as follows:

For example, if passed the following input string:

the method returns the following string:

For simple evaluations, as in the preceding example, the new syntax is not much different from the old syntax. However, for complex evaluations, the new syntax is much clearer. For example, consider the following ambiguous expression that uses the old syntax:

The preceding expression does not clarify which part of the expression should be evaluated first. Fortunately, the new syntax permits nesting. For example, the following str tells ResolveVariables to evaluate the expression in stages:

The order of evaluation in the preceding expression is as follows:

Returns

String with embedded variables resolved.

errno

Use GetErrno to view the error. Possible values of errno include:

Value
Description
-106
You set new to true and specified invalid variable references in str.

 

 

  Home > Contents > Index >

FatWire JAVA Reference
Copyright 2005 by FatWire Software
All rights reserved.