Your IP : 216.73.216.48


Current Path : /usr/X11R6/share/epic5/help/6_Functions/
Upload File :
Current File : //usr/X11R6/share/epic5/help/6_Functions/unshift

# $EPIC: unshift,v 1.3 2001/07/24 23:29:02 jnelson Exp $
Synopsis:
   $unshift(<variable name> <word list>)

Technical:
   * If the <variable name> argument is omitted the empty string is returned.
   * If the <word list> argument is omitted the rvalue of $<variable name>
     is returned.
   * If the value of $<variable name> is the empty string, then the value
     of $<variable name> is set to <word list>.
   * If the value of $<variable name> is not the empty string, then the value
     of $<variable name> is set to <word list> plus a space plus the old value
     of $<variable name>.
   * The new value of $<variable name> is returned.
   * <variable name> must not be prefixed with a $.

Practical:
   Whereas the "shift" operation removes the first word from a word list
   (or variable), the "unshift" operation prepends words to the beginning
   of a word list in a variable and assigns the result back to the variable.

Returns:
   The new value of $<variable name> after the unshift.

Examples:
   assign -foo
   $unshift(foo blah)      assigns "blah" to $foo and returns "blah"
   $unshift(foo booya)     prepends "booya " to $foo and returns "booya blah"

See Also:
   pop(6); push(6); shift(5); unshift(5)