1mNAME0m
       variable - create and initialize a namespace variable

1mSYNOPSIS0m
       1mvariable 22m?4mname24m 4mvalue...24m? 4mname24m ?4mvalue24m?


1mDESCRIPTION0m
       This command is normally used within a 1mnamespace eval 22mcommand to create
       one or more variables within a namespace.  Each variable 4mname24m  is  ini-
       tialized with 4mvalue24m.  The 4mvalue24m for the last variable is optional.

       If  a  variable  4mname24m  does not exist, it is created.  In this case, if
       4mvalue24m is specified, it is assigned to the newly created  variable.   If
       no  4mvalue24m  is  specified,  the  new variable is left undefined.  If the
       variable already exists, it is set to 4mvalue24m if 4mvalue24m  is  specified  or
       left  unchanged  if  no  4mvalue24m is given.  Normally, 4mname24m is unqualified
       (does not include the names of  any  containing  namespaces),  and  the
       variable  is  created  in  the current namespace.  If 4mname24m includes any
       namespace qualifiers, the variable is created in the  specified  names-
       pace.  If the variable is not defined, it will be visible to the 1mnames-0m
       1mpace which 22mcommand, but not to the 1minfo exists 22mcommand.

       If the 1mvariable 22mcommand is executed inside a Tcl procedure, it  creates
       local  variables  linked  to the corresponding namespace variables (and
       therefore these variables are listed by 1minfo locals22m.)  In this way  the
       1mvariable 22mcommand resembles the 1mglobal 22mcommand, although the 1mglobal 22mcom-
       mand only links to variables in the global namespace.   If  any  4mvalue24ms
       are  given, they are used to modify the values of the associated names-
       pace variables.  If a namespace variable does not exist, it is  created
       and optionally initialized.

       A  4mname24m argument cannot reference an element within an array.  Instead,
       4mname24m should reference the entire array, and  the  initialization  4mvalue0m
       should  be  left  off.   After the variable has been declared, elements
       within the array can be set using ordinary 1mset 22mor 1marray 22mcommands.


1mSEE ALSO0m
       global(n), namespace(n), upvar(n)


1mKEYWORDS0m
