Maptitude GISDK Help

GetText(), T()

Summary

Generates a formatted string.

 

Syntax

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

Returns

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.

 

Notes

 

Examples

 

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 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