Subject: | |
From: | |
Reply To: | |
Date: | Thu, 18 Feb 1999 13:11:22 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Paul asks:
> Does anyone have an example in C on how to retrieve the value of a CI Boolean
> variable. I'm trying to make a small enhancement to a utility and I've been
> having some difficulty turning on some trace functions based on the settings of
> certain CI variables.
Walter gave one answer. Here's a different version...
if you're running under the shell, and you want to access an HP CI variable
that existed prior to starting the shell, then it's been turned into a
shell variable you can see. (Try: env to see list of variables).
Boolean CI variables are turned into the string "TRUE" or "FALSE" (not
numbers!). Thus, if the session variable FOO is TRUE, then when you
enter the shell, and do:
char *p;
p = (char *) getenv ("FOO");
if (p)
(void) printf ("FOO = %s\n", p);
you should see "TRUE" or "FALSE" get printed.
NOTE: all of the HP CI predefined variables that are "dynamic" in
nature (e.g.: HPJOBCOUNT) are evaluated at the shell startup...and can
therefore be inaccurate when you check them later. (As in HPJOBCOUNT,
HPTIMEF, etc.)
--
Stan Sieler [log in to unmask]
http://www.allegro.com/sieler.html
|
|
|