Maptitude GISDK Help |
Generates a formatted string.
a = GetText(string format, opt array args, opt string context)
Argument |
Contents |
format |
A string format, that uses format specifiers such as %s (string), %d (integers), and %6.2lf(long float), to define the string. |
args |
Optional. An array in which each element is a macro expression in Caliper Script. |
context |
Optional. A string which assists to identify the different translations for the same English words. |
No options are currently supported.
v
An array with an index (0 if not found) for each search spec, even if input_array is null, or null if specs_array is null.
The format string is replaced with string defined in the args array.
Format specifiers%1,...,%9 are substituted first; followed by other %* substitution.
A double %% will appear as a single % in the output and will not use any arguments from the args array.
The expression in the args array must return values that match the type specified by the corresponding %* format specifier in the output string. Currently, only string and numerical data types are supported.
set_name = "Selection"
count = GetSetCount(set_name)
text = "There are %d records in set %s"
new_text = GetText(text , {count, set_name}) // new_text is "There are 4 records in set Selection"
avg = 1.458894
property = "sale"
text = "The average %s is %.2lf"
new_text = GetText(text , { property, avg }) // new_text is The average sale is " 1.46"
Error Type |
Meaning |
Error |
Invalid prototype string for format tags (%s) or mismatch in data type. The order of the format specifiers do not match the order of the args types |
©2025 Caliper Corporation | www.caliper.com |