Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!portal!atari!kbad From: kbad@atari.UUCP (Ken Badertscher) Newsgroups: comp.sys.atari.st Subject: Re: setenv on boot-up (how?) Summary: TOS does not have a unique environment variable format. Keywords: environment, standards Message-ID: <1407@atari.UUCP> Date: 27 Mar 89 00:27:57 GMT References: <747@stag.UUCP> Reply-To: kbad@atari.UUCP (Ken Badertscher) Organization: Atari Corp., Sunnyvale, CA Lines: 34 Dale posts some very useful code for dealing with environment variables. However, the part of the code that deals with the TOS environment will hopefully be obsolete very soon. The fact that there is a null after the PATH= in the default TOS environment string is an anachronism left over from a bug in earlier TOS versions, to wit; the BIOS variable which holds the value of the boot device was used as a WORD instead of as a BYTE when filling the startup environment string, hence you get a null before the drive letter. This is not standard, nor should it be construed as a "TOS" format environment. The easiest way to check for the default environment is with a couple of longword compares (look for "PATH" then "=;\0" <- really four characters there, =, ;, , A or C ). GEMDOS environment strings are: ...a series of null-terminated strings of the format "VAR=value"; the last string is followed by two zero bytes, indicating the end of the environment. - Pexec Cookbook Which is to say, they follow the somewhat universal environment string standard, a'la UNIX(tm) or MS-DOS(tm). The fact that semicolons were required to separate path names was an oversight as well; TOS 1.4 allows commas or semicolons to separate pathnames in the PATH environment variable. In fact, the AES now uses the environment much more intelligently, and will look down whatever paths you have specified for shel_find and rsrc_load calls. Hopefully someday I'll get to release the auto/accessory environment setting utility that I've written; I think people will like being able to stick their resources all in one folder... -- Ken Badertscher | #include Atari R&D Software Engine | GEMDOS LIVES! ...or is that Frodo? {portal,ames,imagen}!atari!kbad | I can never remember these things...