Site Tools


assign

Synopsis:

assign
assign <variable name>
assign -<variable name>
assign <variable name> <value>

Description:

ASSIGN is the general-purpose interface for creating and manipulating variables. Just about any value can be assigned, whether it be a string or a number. Internally, the language is untyped; every variable is a string. But if you use a variable containing a number in a place where a number is expected, it will be automatically converted for you.

The rules for variable names are similar to those of the C language; they may consist of any letter, digit, or the underscore (_) character, and they must begin with a letter. Unlike C, variable names are not case-sensitive (nor are their contents, though they are case-preserving).

ASSIGN is primarily used for string assignments. It can be used for mathematical purposes as well, using the ${} construct, but it can very quickly become awkward and cumbersome. Mathematical operations are better suited to the @ modifier (see Expressions).

Examples:

To assign a text string to the variable $foo:

    assign foo this is some text string

To compute the sum of two integers:

    assign foo ${4 + 5}

To delete a variable:

    assign -foo

See Also:

History

The assign command first appeared in ircII.

#$EPIC: assign.txt,v 1.3 2007/10/13 17:06:43 jnelson Exp $

assign.txt · Last modified: 2007/10/13 17:06 by 127.0.0.1