Site Tools


assign
no way to compare when less than two revisions

Differences

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


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