home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / help / 5_programming / assign < prev    next >
Encoding:
Text File  |  2002-10-28  |  1.7 KB  |  42 lines

  1. Synopsis:
  2.    assign [[-]<variable name> [<value>]]
  3.  
  4. Description:
  5.    ASSIGN is the general-purpose interface for creating and manipulating
  6.    variables.  Just about any value can be assigned, whether it be a
  7.    string or a number.  Internally, ircII-EPIC treats the contents of all
  8.    variables as strings, though it is smart enough to distinguish between
  9.    strings and numerical values for mathematical purposes.
  10.  
  11.    The rules for variable names are similar to those of the C language;
  12.    they may consist of any letter, digit, or the underscore (_) character,
  13.    and they must begin with a letter.  Unlike C, variable names are not
  14.    case-sensitive (nor are their contents, though they are case-preserving).
  15.  
  16.    ASSIGN is primarily used for string assignments.  It can be used for
  17.    mathematical purposes as well, using the ${} construct, but it can very
  18.    quickly become awkward and cumbersome.  Mathematical operations are
  19.    better suited to the @ modifier (see Expressions).
  20.  
  21. Examples:
  22.    To assign a text string to the variable $foo:
  23.       assign foo this is some text string
  24.  
  25.    To compute the sum of two integers:
  26.       assign foo ${4 + 5}
  27.  
  28.    To delete a variable:
  29.       assign -foo
  30.  
  31. See Also:
  32.    Expressions(7); Special_Vars(7); alias(5); eval(5); set(4) input_aliases
  33.  
  34. Other Notes:
  35.    The default behavior of the client is to not treat variables specially
  36.    on the command line; they are passed as literal text.  Variables normally
  37.    are only expanded when used inside an alias.  This naturally poses a
  38.    problem for using ASSIGN with the ${} construct from the input line.  To
  39.    force $ expansion on the input line, set INPUT_ALIASES to on, or use EVAL.
  40.    This is not a bug, it is a general feature of all commands.
  41.  
  42.