Function Reference


Return the value of the variable defined by a string.

Eval ( string )


string string representing name of the variable.

Return Value

Success: the value of the variable.
Failure: "" (empty string) and sets the @error flag to non-zero.


If there is a need to use Eval() to read a variable, then in most situations Assign() should be used to create/write to the variable and IsDeclared() should be used to check that the variable exists.


Assign, Execute, IsDeclared


#include <MsgBoxConstants.au3>


Func Example()
    ; Assign the variable string sString with data.
    Assign("sString", "This is a string which is declared using the function Assign")

    ; Find the value of the variable string sString and assign to the variable $sEvalString.
    Local $sEvalString = Eval("sString")

    ; Display the value of $sEvalString. This should be the same value as $sString.
    MsgBox($MB_SYSTEMMODAL, "", $sEvalString)
EndFunc   ;==>Example