Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

assign [2007/10/13 17:06] (current)
Line 1: Line 1:
 +assign \\ 
 +assign //<[[lva|variable name]]>// \\ 
 +assign -//<[[lval|variable name]]>// \\ 
 +assign //<[[lval|variable name]]>// //<value>//
 +__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]]).
 +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:======
 +[[Expressions]]; [[Special_Vars]]; [[alias command|alias]]; [[eval]];
 +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 (external edit)