HP3000-L Archives

February 1999, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Thu, 18 Feb 1999 13:11:22 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (32 lines)
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

ATOM RSS1 RSS2