#unset & #unsetenv Directives

[posted 2004/10/26]

[Notes issued with the release of PIKT 1.18.0pre2, which introduced the new #unset & #unsetenv directives, also new #set & #setenv variants.]

PIKT 1.18.0pre2 adds the new #unset and #unsetenv preprocessor directives, which undo the effects of the #set and #setenv directives.

It is now also possible to use #set and #setenv without specifying assigned values, in which case the environment variable is implicitly set to 1.  So

#set foo

is equivalent to

#set foo = "1"

and

#setenv foo "1"

If you do this in one of your configuration files

#set foo
#include <files/this_files.cfg>
#unset foo

you could have in this_files.cfg

#include [test $foo && /bin/cat /pikt/lib/configs/files/that_files.cfg]

or perhaps #include the output of some process

#include [/usr/local/bin/bar.pl]

where bar.pl references the $foo environment variable, for example with

if ($ENV{foo}) {
        ...
}

Once again, at pikt.org, we use #set (and #setenv) and #unset (and #unsetenv) to pass parameters from parent configuration files to their children #include files.  Eventually, using examples from our website operations at pikt.org (also earlymusichicago.org), we hope to explain all of these new advanced preprocessing directives and techniques in greater detail.

Open Hand For more examples, see Developer's Notes.

 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2008-02-27.   This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.   Copyright © 1998-2008 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
network
service test
macros