home *** CD-ROM | disk | FTP | other *** search
- type
- Str80 = string[80] ;
- { Procedure to write formatted output to a given location on the screen. }
- { This one procedure can accept real and integer numbers and formate them }
- { as in standard turbo calls. It also can accept byte and string }
- { variables as input. Nice all around formatted write procedure. I don't}
- { understand the inline code but I assume that it is used to write the }
- { information to the video buffer. }
- { Feb. 15, 1986 Madison, WI IBM PC UG Turbo SIG Librarian, }
- { -CAR- }
- procedure Fwrite(col,row : integer ; attrib : byte ; VarType : char ;
- var Arg ; NumPos,NumDec : integer) ;
- var
- RealNum : real absolute Arg ;
- IntNum : integer absolute Arg ;
- ByteNum : byte absolute Arg ;
- InStr : Str80 absolute Arg ;
- OutStr : Str80 ;
- begin
- col := col - 1 ;
- row := row - 1 ;
- case UpCase(VarType) of
- 'R' : Str(RealNum:NumPos:NumDec,OutStr) ;
- 'I' : Str(IntNum:NumPos,OutStr) ;
- 'B' : Str(ByteNum:NumPos,OutStr) ;
- 'S' : OutStr := InStr ;
- else
- Exit ;
- end ;
- inline
- ($1E/$1E/$8A/$86/row/$B3/$50/$F6/$E3/$2B/$DB/$8A/$9E/col/
- $03/$C3/$03/$C0/$8B/$F8/$be/$00/$00/$8A/$BE/attrib/
- $8a/$8e/OutStr/$22/$c9/$74/$3e/$2b/$c0/$8E/$D8/$A0/$49/$04/
- $1F/$2C/$07/$74/$22/$BA/$00/$B8/$8E/$DA/$BA/$DA/$03/$46/
- $8a/$9A/OutStr/$EC/$A8/$01/$75/$FB/$FA/$EC/$A8/$01/$74/$FB/
- $89/$1D/$47/$47/$E2/$Ea/$2A/$C0/$74/$10/$BA/$00/$B0/
- $8E/$DA/$46/$8a/$9A/OutStr/$89/$1D/$47/$47/$E2/$F5/$1F);
- end ;
-
- var
- Strng : Str80 ;
- ByteVal : byte ;
- IntVal : integer ;
- RealVal : real ;
- begin
- ClrScr ;
- Strng := 'This is a test' ;
- FWrite(10,10,7,'s',Strng,1,0) ;
- ByteVal := 20 ;
- FWrite(12,11,7,'b',ByteVal,1,0) ;
- IntVal := 2000 ;
- FWrite(14,12,7,'i',IntVal,1,0) ;
- RealVal := 1.6667098E12 ;
- FWrite(16,13,7,'r',RealVal,10,25) ;
- end.