:=, = Assignment operators

Purpose

Assigns an expression or value to a variable.

Syntax

varname := value

varname = value

Description

Assignment operator := is often used with assignment of arguments of OLE object properties, this is called passing named arguments. Using named arguments are provided as a shortcut for typing argument values. With named arguments, you can provide any or all of the arguments, in any order, by assigning a value to the named argument. You do this by typing the argument name plus a colon followed by an equal sign and the value ( Argument := Value) and placing that assignment in any sequence delimited by commas.

Example

Local a$

a$ := "Hello"

a$ = "Hello"

Named arguments with objects. Notice that the arguments in the following example are in the reverse order of the expected arguments:

// Raises the error: "Put #/Get # without field and without variable"

Err.Raise Description := "", Number := 71

See Also

+=, -=, /= , *=, Operator Hierarchy

{Created by Sjouke Hamstra; Last updated: 18/09/2014 by James Gaite}