Path: utzoo!attcan!uunet!mcsun!unido!rwthinf!cip-s02!wolfram From: wolfram@cip-s02.informatik.rwth-aachen.de (Wolfram Roesler) Newsgroups: comp.sys.atari.st Subject: Re: Environment variables in GEM Message-ID: Date: 31 Jan 91 10:55:26 GMT References: <1654@abekrd.UUCP> Sender: news@rwthinf.UUCP Distribution: comp Lines: 39 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