DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing Deskshell commands

Global variables

Global variables can be accessed by all threads in a Desktop session. They are created by prefixing the variable name with ``:''.

For example:

   :count=10
creates a global variable count with the value ``10''.

Global variables can be accessed with the constructs $:var, $#:var, and so forth. Global variables are distinct from local variables with the same name, so you can have:

   count=12
and
   :count=10
as separate variables. However, $var will give the value of the global variable var if no local variable has been defined.

See also:


Next topic: Variable overriding
Previous topic: Local variables

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 26 May 2005