Maptitude GISDK Help

GetText(), T()

Summary

Returns a string, formatted and substituted according to the the format and the arguments.

 

Syntax

text = 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.

 

No options are currently supported.

 

Returns

A formatted string, with all format specifiers replaced by the corresponding macro expression, (i.e. the values of array elements in the 2nd argument).

 

Notes

 

Examples

 

set_name = "Selection"
count = GetSetCount(set_name)
text1 = "There are %1 records in set %2"

text2 = "Set %2 has 1% records"
new_text1 = GetText(text1 , {count, set_name}) // new_text1 is  "There are 4 records in set Selection"

new_text2 = GetText(text2 , {count, set_name})  // new_text2 is "Set Selection has 4 records"

 


avg = 124.458894
property = "sale"
text = "The average %s is %.2f"
new_text = GetText(text , { property, avg }) // new_text is The average sale is " 124.46"

 

 

 

 

Error Codes

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