GetString

This function will return the Translation Text from the Text Resource (the files containing the TextIds, strings, and translated values for each string) that was saved as part of the application configuration. There are two ways this command can be used. Either enter the Text ID and optionally the default text value, or just enter the Text Resource value in place of the Text ID with no optional default text parameter. If no default is specified, App.GetString will use the TextId as the default.

Group: Application-Based Extension


Syntax: sValue = App.GetString(TextID, [vDefaultText])

sValue          (String) is the text string extracted from the Text Resource based on the locale of the client.

TextID          (Variant) is the Text ID value acting as a key to the Text Resource. Alternatively it can be the Text Resource value (an alternate key) to the Text Resource.

vDefaultText (Variant) Optional – is the text to be used if the Text ID cannot be located in Text Resources.

Example:

Dim sText As String

If the keys for a text resource were:

Text Id: 25

Text Resource: Hello

and the translation grid contained:

Locale: English

String Value: Hello There!

sText = App.GetString(25)

sText = Hello There!

sText = App.GetString(25, "Hello")

sText = Hello There!

sText = App.GetString("Hello")

sText = Hello There!

sText = App.GetString(99, "Hello")

sText = Hello  - Because the ID could not be found the default text was used

sText = App.GetString(99)

sText = <nothing> - Because the ID could not be found and there was no default text

sText = App.GetString("Hi")

sText = Hi - Because the ID could not be found but it was of string type so it was considered the default text

Version Supported:      RFgen 4.0, 4.1, 5.0, 5.1, 5.2 and newer.