"setText" (langString::setText)

The function sets a text of a langString to the given string.

Synopsis

int langString.text(string text);

int langString.text(int index, string text);

int langString.text(string lang, string text);

int langString.text(OaLanguage lang, string text);

Parameters

Parameter Description
index Index of the language entry. The index starts at 1.
lang String or OaLanguage enum that defines a language
text The text to be entered

Return Value

The function returns 0 if it is executed successfully.

Description

This function sets the text of a langString to the specified string. The index and lang parameters identify the language for the provided text.

Depending on the additional parameter, the entry is made as follows:

Parameter Entry
- Sets the text for the currently active language.
int index Sets the text for the language with the given index. The index starts at 1.
string lang Sets the text for the language defined by the string.
OaLanguage lang Sets the text for the language (ID) defined by the enum.

Example

A langString is made and the entry for English is changed.

main()
{
  dyn_string word;
  word[1] = "Information";
  word[2] = "information";
  langString langWord = word;
  langWord.setText(OaLanguage::en_US, "new Information");
  DebugN(langWord.text(OaLanguage::en_US) );
}

Assignment

Miscellaneous Functions

Availability

CTRL