comp.lang.ada
 help / color / mirror / Atom feed
* Setting Environment Variables
@ 2000-05-08  0:00 John Lee
  2000-05-08  0:00 ` Gisle S�lensminde
  2000-05-08  0:00 ` Larry Kilgallen
  0 siblings, 2 replies; 6+ messages in thread
From: John Lee @ 2000-05-08  0:00 UTC (permalink / raw)


How does one set an environment variable in Ada?  Is there an Ada system
function or must I interface with the C setenv function?  Thanks.

John Lee


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setting Environment Variables
  2000-05-08  0:00 Setting Environment Variables John Lee
@ 2000-05-08  0:00 ` Gisle S�lensminde
  2000-05-08  0:00 ` Larry Kilgallen
  1 sibling, 0 replies; 6+ messages in thread
From: Gisle S�lensminde @ 2000-05-08  0:00 UTC (permalink / raw)


In article <8f6h8h$5ee$1@nnrp1.deja.com>, John Lee wrote:
>How does one set an environment variable in Ada?  Is there an Ada system
>function or must I interface with the C setenv function?  Thanks.

You must import it from the OS, it's not available in standard Ada.

By the way, the setenv function is a part of the OS, not C, but yes, 
it has has C linker conventions and is most likely implemented in C. 

--
Gisle S�lensminde ( gisle@ii.uib.no )   

ln -s /dev/null ~/.netscape/cookies




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setting Environment Variables
  2000-05-08  0:00 Setting Environment Variables John Lee
  2000-05-08  0:00 ` Gisle S�lensminde
@ 2000-05-08  0:00 ` Larry Kilgallen
  2000-05-11  0:00   ` David Emery
  1 sibling, 1 reply; 6+ messages in thread
From: Larry Kilgallen @ 2000-05-08  0:00 UTC (permalink / raw)


In article <8f6h8h$5ee$1@nnrp1.deja.com>, John Lee <lee@orion-sim.com> writes:
> How does one set an environment variable in Ada?  Is there an Ada system
> function or must I interface with the C setenv function?  Thanks.

On Alpha VMS you would call STARLET.SETENV to change a console
environment variable, but most likely that is not what you had
in mind.  The notion of "environment variables" is tied to the
operating system you use, and for VMS the C language construct
can be either a logical name or a DCL symbol, as I recall.

The bottom line is, for operating system specific discussions
you really need to specify your operating system in order to
get the answer you want.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setting Environment Variables
  2000-05-08  0:00 ` Larry Kilgallen
@ 2000-05-11  0:00   ` David Emery
  2000-05-12  0:00     ` Samuel T. Harris
  0 siblings, 1 reply; 6+ messages in thread
From: David Emery @ 2000-05-11  0:00 UTC (permalink / raw)


This is specified in POSIX/Ada, since it's really an OS operation.

         dave




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setting Environment Variables
  2000-05-11  0:00   ` David Emery
@ 2000-05-12  0:00     ` Samuel T. Harris
  2000-05-12  0:00       ` David C. Hoos, Sr.
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel T. Harris @ 2000-05-12  0:00 UTC (permalink / raw)


David Emery wrote:
> 
> This is specified in POSIX/Ada, since it's really an OS operation.
> 
>          dave

So are command-line arguments but they are supported
directly in Ada 95. I find this "its an OS operation"
line of reasoning dubious. Ada.Command_Line specifies
what happens when an implementation has no command-line,
so why not have an Ada.Environment as well?!!!

But since we don't, POSIX is the next best thing.

-- 
Samuel T. Harris, Principal Engineer
Raytheon, Aerospace Engineering Services
"If you can make it, We can fake it!"




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Setting Environment Variables
  2000-05-12  0:00     ` Samuel T. Harris
@ 2000-05-12  0:00       ` David C. Hoos, Sr.
  0 siblings, 0 replies; 6+ messages in thread
From: David C. Hoos, Sr. @ 2000-05-12  0:00 UTC (permalink / raw)



Samuel T. Harris <samuel_t_harris@Raytheon.com> wrote in message
news:391C43C9.5F7DA9E3@Raytheon.com...
> David Emery wrote:
> >
> > This is specified in POSIX/Ada, since it's really an OS operation.
> >
> >          dave
>
> So are command-line arguments but they are supported
> directly in Ada 95. I find this "its an OS operation"
> line of reasoning dubious. Ada.Command_Line specifies
> what happens when an implementation has no command-line,
> so why not have an Ada.Environment as well?!!!
>
Well, reading the existing environment could, of course, be
easily done.  But... setting an environment variable often
requires enlarging the environment space -- meaning copying
the old stuff plus the modification, and deallocating the old, etc.
Some flavors of UNIX don't (or at least didn't 8 years ago) support
setenv, and I remember that VADS was seriously broken on at
least one platform, at that time with an Ada procedure for Setenv.







^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-05-12  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-08  0:00 Setting Environment Variables John Lee
2000-05-08  0:00 ` Gisle S�lensminde
2000-05-08  0:00 ` Larry Kilgallen
2000-05-11  0:00   ` David Emery
2000-05-12  0:00     ` Samuel T. Harris
2000-05-12  0:00       ` David C. Hoos, Sr.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox