Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!luth!sunic!tut!tucos!kontu!eholmberg From: eholmberg@kontu.utu.fi Newsgroups: comp.lang.pascal Subject: Re: Various Turbo pascal questions Message-ID: <14711.2574e3f4@kontu.utu.fi> Date: 30 Nov 89 08:25:24 GMT References: <2185@leah.Albany.Edu> <257452CA.28297@maccs.dcss.mcmaster.ca> Lines: 24 In article <257452CA.28297@maccs.dcss.mcmaster.ca>, cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) writes: > In article <2185@leah.Albany.Edu> ppd491@leah.Albany.Edu (Peter P. Donohue) writes: > $ 3) Is there a way to read the 'variables' (I'm not sure of the exact > > I don't know if TP has any built-in functions to handle this ... if > not, you have to check out the word at PSP:$2C. This is the segment Beginning from Turbo Pascal version 5.0, there is a way to read in environment variables: the function GetEnv. If you want to find out for example what's stored in the variable PROCOMM, simply call x := GetEnv('PROCOMM'); in your program, and x contains the variable. (GetEnv returns type String, so x must be String, too..). Unfortunately, there seems to be no (clean) way to change the environment variables from a program.. :-( +--------------------------------------------------------------------+ ! E. K. Holmberg, eholmberg@kontu.utu.fi (Internet) ! ! kontu::eholmberg (Decnet) ! +--------------------------------------------------------------------+ ! Also at SAS-(M)BBS (+358-21-518-994, 24h, V.32 ECM, 1200-9600 bps) ! +--------------------------------------------------------------------+