#### 4.2.2 To store a string

From version 1.97, TeXgraph’s variables can store strings. But we can also use a macro that can play this role.

To create a macro-string (that part is here for backward compatibility):

• SetStr( <name>, <expression> [, evaluate] )
• Description: create the macro called <name> whose command is defined by the <expression>, if <evaluate> is $1$ (default value) Then the expression is evaluated as a string, else the <expression> is copied in the macro corpus as is. The argument <name> is alphanumerically evaluated.
• Exemple(s)
• the command SetStr( test, sqrt(4)) will create a macro whose name is test with the value (a string): "2",
• The command SetStr( test, sqrt(4), 0) will create a macro called test whose value is the string : sqrt(4) (without quotes).
• The command SetStr( name, ["My name is ", %1], 0) will create a macro called name whose value is the string : ["My name is ", %1], At the execution of Message( @name("toto") ) we will see the display My name is toto. Then a macro can be used as a function with one or more parameters returning a string.

To get the value of a macro-string (that part is here for backward compatibility):

• GetStr( <name> ) or GetStr( <name(arguments)> )
• Description: evaluate alphanumerically the macro called <name> and returns the resulting string. There is a shortcut to that command, by adding the character @ before the <name>.
• Exemple(s)Message( @name ) will have the same effect as Message( GetStr( name ) ).