Text_GetString (Reserved Word)

image\trumpet2.gif Disclaimer

This reserved word returns the text string expression corresponding to the text object specified. It is important to remember that if an invalid ID number is used, the reserved word will return a value of -2 and no additional operations will be performed on any text objects by the trading strategy, analysis technique, or function that generated the error.

MyText = Text_GetString(Text_ID)

Text_ID is or a numeric expression representing the ID number of the text object whose text string expression you want to obtain.

MyText is any text variable or array, and holds the text string expression corresponding to the text object with the ID number specified.

Remarks

When the reserved word performs its operation successfully, the text string is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see EasyLanguage Drawing Object Error Codes.

Example

The following returns the text string used by the text object with the identification number 1. In order to obtain the text string, you must assign the reserved word to a string variable, as follows:

Variable: MyText ("") ;
MyText = Text_GetString(1);

  EasyLanguage doesn’t provide pre-declared string variables so you will have to declare your own string variable in order to assign the reserved word to it.

Additional Example

The following statement prints the contents of text object #5 to the Print Log:

Print( Text_GetString(5) );