[comp.sys.atari.st] Environment variables in GEM

mike@abekrd.UUCP (Mike Quinn) (01/23/91)

An increasing number of programs require special environment variables before
they will function correctly (at all). I want to be able to set-up these
variables within my GEM desktop and then just execute .TTPs as required.

Do I just add lines to ASSIGN.SYS, or is life not that simple ? If that is
the answer what format should the line be, is it just:

VARIABLE=value

like the path commands?


Seeking enlightenment (as always),

-- 
Mike Quinn.			net:  mike@abekrd.co.uk
Abekas Video Systems Ltd.	UUCP: ...!uunet!mcsun!ukc!pyrltd!abekrd!mike
Reading.
United Kingdom.			_AH-CHOO!!_   *whew* ...no brains!  (Calvin)  

jvt@its.bt.co.uk (John Trickey) (01/24/91)

In article <1654@abekrd.UUCP> mike@abekrd.UUCP (Mike Quinn) writes:
>An increasing number of programs require special environment variables before
>they will function correctly (at all). I want to be able to set-up these
>variables within my GEM desktop and then just execute .TTPs as required.
>
>Do I just add lines to ASSIGN.SYS, or is life not that simple ? If that is
>the answer what format should the line be, is it just:

I am not aware of being able to do this and anyway it would cause the
variables not to appear if you are not using GDOS.

>VARIABLE=value
>
>like the path commands?
>

This is exactly right if you are using ENVIRON.PRG (in your \auto folder).
The data is held in the root dir in ENVIRON.DAT.  This is what I do & it
works fine.

On atari.archive the file is utilities/environ.arc or it comes on the
geminiuk distribution.

John

-- 
John Trickey <jvt@its.bt.co.uk> || ..!mcsun!ukc!axion!its
              G4REV @ GB7SUT      Voice: +44 21 333 3369
#include <std/disclaimer>

wolfram@cip-s02.informatik.rwth-aachen.de (Wolfram Roesler) (01/31/91)

mike@abekrd.UUCP (Mike Quinn) writes:

>An increasing number of programs require special environment variables before
>they will function correctly (at all). I want to be able to set-up these
>variables within my GEM desktop and then just execute .TTPs as required.

>Do I just add lines to ASSIGN.SYS, or is life not that simple ? If that is
>the answer what format should the line be, is it just:

>VARIABLE=value

>like the path commands?

The safest way to set env vars is to use a command shell that can do this.
Desktop doesnt support the feature, although AES does (RSC files will be
sought on all folders that are in PATH if not found). The Okami Shell makes
use of env vars, and so does Gulam. Forget any shell that does not.

Some tech info wanted?
The pointer to a process's environment is in the basepage (Offset 0x2c I
suppose). It points to a memory area which has the following format:

	{VarName=Value\0}\0

, meaning there is a set of \0-terminated character strings, each of the
format "Name=Value". The set itself is \0-terminated, so a double \0
indicates the end of the list.
Sometimes another \0 is included after the '='. 
When a program is executed using Pexec, the last argument of Pexec is   
placed in the new process's basepage to make the env pointer. If the last
argument is NULL, the calling process's env pointer will be used, so make
sure to pass NULL instead of "" when executing programs from programs that
do not make use of the environment.

Using the environment is merely a lot of what we call in german "pointerfummelei".

Hope to have helped you

Okami-San