Assign

From AutoIt Wiki

Jump to: navigation, search

Assign assigns a value to a variable. In most situations simple assignment may be used in place of Assign, Eval() to read, and IsDeclared() to check. Adapted from AutoIt docs.

Contents

Syntax

$x = Assign("varname","value" [, flag])

Parameters

varnameName of the variable to assign.
valueValue to be assigned to the variable.
flagControls assignment.(Optional)

Flags

FlagUsage
0Create a variable if required.(default)
1Force creation in Local Scope.
2Force creation in Global Scope.
4Fail if variable does not already exist.

Return Value

Success returns 1. Failure returns 0 if unable to create/assign the variable.

Example

Global $var = 0   ; is equivalent to
Assign("var",0,2)

Related Functions

Eval IsDeclared

Personal tools