Xref: utzoo comp.sys.ibm.pc:38686 comp.lang.pascal:2726 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!apple!agate!shelby!portia!gaia From: gaia@portia.Stanford.EDU (fai to leung) Newsgroups: comp.sys.ibm.pc,comp.lang.pascal Subject: Re: Various Turbo pascal questions Keywords: Turbo pascal Message-ID: <6972@portia.Stanford.EDU> Date: 23 Nov 89 21:51:13 GMT References: <2185@leah.Albany.Edu> Sender: fai to leung Reply-To: gaia@portia.Stanford.EDU (fai to leung) Followup-To: comp.sys.ibm.pc Organization: Stanford University Lines: 32 In article <2185@leah.Albany.Edu> ppd491@leah.Albany.Edu (Peter P. Donohue) writes: > > I have a few questions pertaining to programming in Turbo Pascal 5.5 >under the MS-Dos operating system. Any help with these would be >appreciated. > > 1) In an external data file (containing all ascii data), what is the >maximum length of a line allowed? I would say 255 characters long. Pascal strings format are byte[0]=length of string follow by the ascii chars. > 2) Is there a way to read any text that has been written to a screen? >I am writing a program that uses windows (that I write with pascal, not >the program) and I would like to be able to reset what was on the screen >after I clear a window. Character=mem[ScreenBase:(Y*NumberofColumnsOnScreen+X) shl 1]; X,Y starts from 0!!! i.e. wherex-1,wherey-1 ScreenBase of Monochrome $B000; Others $B8000; for some VGA & EGA textmodes $A000 (43,50 lines modes) > 3) Is there a way to read the 'variables' (I'm not sure of the exact >name for them) that are set in AUTOEXEC.BAT with the SET command? An >example is with the program, Procomm, they let you set the path to the >program with the command 'SET PROCOMM=path'. Can you read what procomm >is set to with TP5.5 and how would you do it. YourData=getenv(YourSetStringInEnvironment{e.g. 'PROCOMM});