Path: utzoo!mnetor!uunet!husc6!bbn!rochester!cornell!uw-beaver!mit-eddie!rutgers!mtune!codas!killer!toma From: toma@killer.UUCP (Tom Armistead) Newsgroups: comp.lang.pascal Subject: Re: Enviroment variables (How to determine them...) Message-ID: <2678@killer.UUCP> Date: 6 Jan 88 05:43:19 GMT References: <340@caus-dp.UUCP> Organization: The Org. for the Disorg. of Org. Lines: 26 Keywords: Where do I go from here? Summary: var PreixSeg : word; Points at where you want... In article <340@caus-dp.UUCP>, marcos@caus-dp.UUCP (Marcos R. Della) writes: > ... > buffer from [CSEG:$002C] (I think that was the location. No code in front > of me, just memory) and it no longer works as my program is over 64K and > I have no idea what the CSEG will be at the time of program execution nor > can I name any of the files that are at the first CSEG. Does anyone have > a clue as to how to get this information so that I can again read the > enviroment variables under TP4.0? > > Marcos R. Della What you really need to point to the Environment is PSP:$002C, it just so happened that in a COM file PSP and CSEG are the same, this is not the case in an EXE file. TP 4.0 has a variable call PrefixSeg which holds the segment of the PSP, so something like this would work now: var EnvPtr : pointer absolute PrefixSeg:$002c; should do it for you, look at page 295 in your Turbo Pascal 4.0 manual... Tom -- ------------- Tom Armistead UUCP: ...!ihnp4!killer!toma