home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
136.ASYNC.INC
< prev
next >
Wrap
Text File
|
1988-10-18
|
23KB
|
557 lines
UNIT TextOps;
INTERFACE
USES
{$IFDEF DOSCrt}
DOSCrt,
{$ELSE}
Crt,
{$ENDIF}
Extended_Reals;
CONST
BELL = #7;
BACKSPACE = #8;
ENTER = #13;
ESC = #27;
NULL = #0; { first code of extended scan codes }
Left = #75; { second code of extended scan code }
Right = #77; { second code of extended scan code }
Up = #72; { second code of extended scan code }
Down = #80; { second code of extended scan code }
PgUp = #73; { second code of extended scan code }
PgDn = #81; { second code of extended scan code }
F1 = #59; { second code of F1 function key }
F2 = #60; { second code of F2 function key }
F3 = #61; { second code of F3 function key }
F4 = #62; { second code of F4 function key }
F5 = #63; { second code of F5 function key }
F6 = #64; { second code of F6 function key }
F7 = #65; { second code of F7 function key }
F8 = #66; { second code of F8 function key }
F9 = #67; { second code of F9 function key }
F10 = #68; { second code of F10 function key }
PROCEDURE WriteXY (s:string; x,y:integer);
PROCEDURE VertLine (x0,y1,y2 : INTEGER);
PROCEDURE HorizLine (x1,x2,y0 : INTEGER);
PROCEDURE frame (leftx, uppery, rightx, lowery: INTEGER);
PROCEDURE String_To_Value ( st : string;
VAR value : REAL;
VAR units : string);
PROCEDURE Value_To_String ( value : REAL;
NumDig : byte;
VAR st : string);
PROCEDURE DrawBorder ( x1 : BYTE;
y1 : BYTE;
x2 : BYTE;
y2 : BYTE);
FUNCTION EXIST (filename : string) : BOOLEAN;
(****************************************************************************)
IMPLEMENTATION
PROCEDURE WriteXY (s:string; x,y:integer);
BEGIN {WriteXY}
GotoXY (x,y);
Write (s);
END; {WriteXY}
{----------------------------------------------------------------------------}
PROCEDURE VertLine (x0,y1,y2 : INTEGER);
CONST
Vertical = '│'; { char (179) }
VAR
i : INTEGER;
BEGIN {VertLine}
FOR i:=y1 TO y2 DO BEGIN
GotoXY (x0,i);
÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ 6: mult:='M';
9: mult:='G';
12: mult:='T';
END; {CASE}
CASE x OF
-12..12: BEGIN
IF factor < 10
THEN x:=NumDig-2
ELSE IF factor < 100
THEN x:=NumDig-3
ELSE x:=NumDig-4;
str (factor:NumDig:x,st);
IF negative
THEN st:='-'+st+' '+mult
ELSE st:= st+' '+mult;
END; {CASE -12..12}
ELSE BEGIN
str (value:(NumDig+6),st);
st:=st+' ';
END; {CASE-ELSE}
END; {CASE}
END; {Value_To_String}
{----------------------------------------------------------------------------}
PROCEDURE DrawBorder ( x1 : BYTE;
y1 : BYTE;
x2 : BYTE;
y2 : BYTE
);
CONST
TopLeft = '╔'; {char(201)}
BottomLeft = '╚'; {char(200)}
TopRight = '╗'; {char(187)}
BottomRight = '╝'; {char(188)}
Vertical = '║'; {char(186)}
Horizontal = '═'; {char(205)}
VAR
i : integer;
BEGIN {DrawBorder}
GotoXY (x1,y1); WriteXY (TopLeft,x1,y1);
GotoXY (x1,y2); Write (BottomLeft);
FOR i:=x1+1 TO x2-1 DO BEGIN
GotoXY (i,y1); Write (Horizontal);
GotoXY (i,y2); Write (Horizontal);
END; {FOR}
GotoXY (x2,y1); Write (TopRight);
GotoXY (x2,y2); Write (BottomRight);
FOR i:=y1+1 TO y2-1 DO BEGIN
GotoXY (x1,i); Write (Vertical);
GotoXY (x2,i); Write (Vertical);
END; {FOR}
END; {DrawBorder}
{----------------------------------------------------------------------------}
FUNCTION EXIST (filename : string) : boolean;
VAR
OK : boolean; (* temporary variable, equal to exist *)
Name : text;
BEGIN {EXIST}
IF length (filename) > 0
THEN BEGIN
Assign (Name,filename);
{$I-} Reset (Name); {$I+}
OK:=(IOresult=0);
exist:=OK;
IF OK THEN Close (Name);
END {THEN}
ELSE EXIST:=false;
END; {EXIST}
(****************************************************************************)
BEGIN {Initialization}
END. {UNIT Text}
ampl^[i]:=ampl^[i]+noise;
END; {FOR}
END; {IF}
END; {AddNoise}
{----------------------------------------------------------------------------}
PROCEDURE AnalyticWaveform;
BEGIN {AnalyticWaveform}
AnalyticMenu;
ClrScr;
CASE ch OF
'1': MakeDampSine;
'2': MakeDoubleExp;
'3': MakeRecipDoubleExp;
'4': MakeGeneralSum;
'9': Exit;
END; {CASE}
AddNoise;
TRANS:=FALSE;
ACCEPT:=TRUE;
ORIG:=TRUE;
GraphResults ('T');
END; {AnalyticWaveform}
(****************************************************************************)
BEGIN {Initialization}
END. {UNIT CreateWaveform}ENTER
THEN NewPlotNum:=ord(ch)-ord('0')
ELSE IF PlotMAG
THEN NewPlotNum:=Logarithmic
ELSE IF PlotPHASE
THEN NewPlotNum:=LogLin
ELSE NewPlotNum:=Linear;
IF PlotPHASE THEN
IF NewPlotNum = Logarithmic
THEN NewPlotNum:= LogLin
ELSE IF NewPlotNum = LinLog
THEN NewPlotNum:= Linear;
IF NewPlotNum <> Plot THEN BEGIN
Plot:=NewPlotNum;
GraphData;
END; {THEN}
END; {ChangePlotType}
{----------------------------------------------------------------------------}
PROCEDURE GraphResults (PlotType : CHAR);
VAR
choice : CHAR;
BEGIN {GraphResults}
X_Units:='';
Y_Units:='';
PlotMAG :=(UpCase(PlotType) = 'M');
PlotPHASE:=(UpCase(PlotType) = 'P');
MinFirst:=0;
IF (PlotMAG OR PlotPHASE)
THEN BEGIN
MaxLast :=pred(NumFreqs);
FOR i:=MinFirst TO MaxLast DO BEGIN
OutArrayX^[i]:=freq^[i];
IF PlotMAG
THEN OutArrayY^[i]:=mag^[i]
ELSE OutArrayY^[i]:=phase^[i]*180/PI;
END; {FOR}
IF PlotMAG
THEN Plot:=Logarithmic
ELSE Plot:=LogLin;
END {then}
ELSE BEGIN
MaxLast :=pred(NumPoints);
FOR i:=MinFirst TO MaxLast DO BEGIN
OutArrayX^[i]:=time^[i];
OutArrayY^[i]:=ampl^[i];
END; {FOR}
Plot:=Linear;
END; {else}
first:=MinFirst;
last :=MaxLast;
InitGraph (GraphDriver,GraphMode,'');
SetViewPort (0,0,GetMaxX,GetMaxY,ClipOn);
IF GraphDriver <> HercMono THEN SetColor (White);
GraphData;
REPEAT
PrintMenu;
REPEAT
choice:=ReadKey;
UNTIL choice IN ['1'..'3','9'];
CASE choice OF
'1': OutputScreen;
'2': ChangePlotType;
'3': ChangeIntervals;
'9': BEGIN
CloseGraph;
TextColor (ForeColor);
TextBackGround (BackColor);
ClrScr;
Exit;
END;
END; {CASE}
UNTIL FALSE;
END; {GraphResults}
{----------------------------------------------------------------------------}
PROCEDURE Graph_Wave;
VAR
ch : CHAR;
BEGIN {Graph_Wave}
IF TRANS
THEN BEGIN
GotoXY (StartColumn,23);
Write ('Time, Magnitude or Phase (T/M/P)?');
REPEAT
ch:=UpCase(ReadKey);
UNTIL (ch IN ['T','M','P',ENTER]);
IF (ch = ENTER)
THEN IF ORIG
THEN GraphResults ('T')
ELSE GraphResults ('M')
ELSE GraphResults (ch);
END {THEN}
ELSE GraphResults ('T');
END; {Graph_Wave}
(****************************************************************************)
BEGIN {INITIALIZATION}
END. {UNIT GraphWaveform}W (TempYPtr);
NEW (OutArrayX);
NEW (OutArrayY);
FillChar (info,SizeOf(info),0);
END; {Initialize_Variables}
{----------------------------------------------------------------------------}
{$IFDEF DOSCrt}
PROCEDURE ClearWindow ( XMin : BYTE; { first column to be erased }
YMin : BYTE; { last column to be erased }
XMax : BYTE; { first row to be erased }
YMax : BYTE { last row to be erased }
);
VAR
x : BYTE;
y : BYTE;
BEGIN {ClearWindow}
FOR y:=YMin TO YMax DO BEGIN
GotoXY (XMin,y);
FOR x:=XMin TO XMax DO Write (' ');
END; {FOR}
END; {ClearWindow}
{$ELSE}
PROCEDURE ClearWindow ( XMin : BYTE; { first column to be erased }
YMin : BYTE; { last column to be erased }
XMax : BYTE; { first row to be erased }
YMax : BYTE { last row to be erased }
);
VAR
CurrXMin : BYTE;
CurrYMin : BYTE;
CurrXMax : BYTE;
CurrYMax : BYTE;
BEGIN {ClearWindow}
CurrXMin:=succ(Lo(WindMin));
CurrYMin:=succ(Hi(WindMin));
CurrXMax:=succ(Lo(WindMax));
CurrYMax:=succ(Hi(WindMax));
Window (XMin,YMin,XMax,YMax);
ClrScr;
Window (CurrXMin,CurrYMin,CurrXMax,CurrYMax);
END; {ClearWindow}
{$ENDIF}
{----------------------------------------------------------------------------}
PROCEDURE Buzzer;
CONST
pitch = 440; { pitch of warning sound }
PauseLengthBBS156 ARC Ñig VTRM220AARC ╞Jî╨LOANS21 ARC
o~-╫4AZEL ARC c$LSSCAN20 ARC ≈eHΓ┴BVTRM220BARC »Lî6▄ESTTAX10ARC ·2╤xVTRANS ARC Nîe°PCPCOUNTARC ╔ug╨UI2DEMO ARC jzg┘8UI2D-----------------------------------------------------------------}
PROCEDURE MainMenu;
BEGIN {MainMenu}
IF GraphDriver <> HercMono THEN BEGIN
TextColor (ForeColor);
TextBackground (BackColor);
END; {IF}
ClrScr;
GotoXY (StartColumn+8,3); Write ('FFT Main Menu (',VersionNumber,')');
GotoXY (StartColumn,5); Write ('Select Option by typing a number:');
GotoXY (StartColumn+8,8); Write ('1. Create Waveform ');
GotoXY (StartColumn+8,10); Write ('2. Retrieve/Save Data ');
GotoXY (StartColumn+8,12); Write ('3. Signal Processing ');
GotoXY (StartColumn+8,14); Write ('4. Graph Results ');
GotoXY (StartColumn+8,16); Write ('5. Advanced Options ');
GotoXY (StartColumn+8,18); Write ('6. Digitizer ');
GotoXY (StartColumn+4,25); Write ('[ESC - Exit to System] ');
GotoXY (StartColumn,21); Write ('Your Choice? ');
REPEAT
Choice:=ReadKey;
UNTIL (Choice IN ['1'..'6',ESC]);
Write (Choice);
END; {MainMenu}
{----------------------------------------------------------------------------}
FUNCTION EXIST (filename : string) : BOOLEAN;
VAR
OK : BOOLEAN; { temporary variable, equal do exist }
Name : text;
BEGIN {EXIST}
IF length (filename) > 0
THEN BEGIN
Assign (Name,filename);
√$I-} Reset (Name); {$I+}
` ` OK:=(IOresult=0);
exist:=OK;
IF OK THEN C∞o≤σ (Name);
END {THEN}
ELSE EXIST:=false;
END; {EXIST
{---------------------------------------------------------)-------------/-/-/}
PROCEDURE PrintErrorMsg ( s : string;
x : BYTE;
y : BYTE;
wait : BOOLEAN;
VAR resp : CHAR
);
CONST
PauseLength = 1000;
VAR
CurrMinX : BYTE;
CurrMinY : BYTE;
CurrMaxX : BYTE;
BEGIN {PrintErrorMsg}
CurrMinX:=x-2;
CurrMinY:=y-1;
CurrMaxX:=CurrMinX+length(s)+4;
IF wait THEN INC(CurrMaxX,1);
-}
{----------------------------------------------------------------------------}
PROCEDURE Add_Comments;
VAR
i : INTEGER;
st : string[80];
BEGIN
ClrScr;
Write ('Test Point: '); ReadLn (st); info[1]:='Test Point: '+st;
Write ('Test Type: '); ReadLn (st); info[2]:='Test Type: '+st;
Write ('Attenuation: '); ReadLn (st); info[3]:='Attenuation: '+st;
Write ('Probe Number: '); ReadLn (st); info[4]:='Probe Number: '+st;
Write ('Comments: '); ReadLn (st); info[7]:='Comments: '+st;
info[5]:='X-Axis units: '+horiz_units;
info[6]:='Y-Axis units: '+vert_units;
FOR i:=8 TO MaxInfo DO info[i]:=blank;
END; {Add_Comments}
{----------------------------------------------------------------------------}
PROCEDURE Digitizer ( DataToDigitize : CHAR);
VAR
STOP : BOOLEAN; { done yet? }
i : INTEGER; { coND. {UNIT Global} }
BEGIN {Digitizer}
FreqDATA:=(DataToDigitize = 'F');
SetGraphMode (GraphMode);
SetViewPort (MinX,MinY,MaxX,MaxY,ClipOn);
SetColor (DrawColor);
STOP:=FALSE;
Initialize_Digitizer;
IF VALID_PORT THEN BEGIN
REPEAT UNTIL NOT Async_Buffer_Check (ch1);
WHILE keypressed DO ch1:=ReadKey;
Set_Up_Axes;
WriteText ('Enter x,y coordinate pairs. ',22,21);
WriteText ('Press ESC to erase, or ENTER to finish.',22,23);
REPEAT
Read_Digitizer;
Read_Keyboard (STOP);
UNTIL STOP;
ClearLine (22,21,40);
ClearLine (22,23,40);
NumPoints:=i-4;
IF (NumPoints >= 5)
THEN BEGIN
RestoreCrtMode;
Rotate_Waveform;
Add_Comments;
SetGraphMode (GraphMode);
Draw_Waveform;
Async_Send_String (Reset_Command);
Async_Close;
WriteText ('Strike any key to return to Main Menu.',22,20);
ORIG:=TRUE;
TRANS:=FALSE;
ACCEPT:=FALSE;
time^:=TempXPtr^;
ampl^:=TempYPtr^;
END {THEN}
ELSE BEGIN
WriteText ('Too few points input. ',22,21);
WriteText ('Strike any key to continue ...',22,23);
ORIG:=FALSE;
TRANS:=FALSE;
ACCEPT:=FALSE;
END; {ELSE}
Quit:=ReadKey;
END; {IF VALID_PORT}
RestoreCRTMode;
TextColor (ForeColor);
TextBackground (BackColor);
ClrScr;
END; {Digitizer}
{----------------------------------------------------------------------------}
PROCEDURE Digitize_Wave;
VAR
ch : CHAR;
BEGIN {Digitize_Wave}
IF (SerialPort <> 0) THEN BEGIN
GotoXY (StartColumn,23);
Write ('Digitize time or frequency data (T/F)? ');
REPEAT
ch:=UpCase(ReadKey);
UNTIL (ch IN ['T','F',ENTER]);
IF (ch = ENTER)
THEN Digitizer ('T')
ELSE Digitizer (ch);
END; {IF}
END; {Digitize_Wave}
(****************************************************************************)
BEGIN {Initialization}
END. {Initialization}├Uâ∞;&ZwΘ½«ï∞ vΦ╛4ïσëFâ─]├Uâ∞;&ZwΘî«ï∞ vΦƒ4ïσëFâ─]├Uâ∞;&ZwΘm«ï∞Φs<â─]├Uâ∞;&ZwΘV«ï∞Φ\<â─]├Uâ∞t;&ZwΘ?«ï∞Φ▐3└PPΦ-ïσ╕D5PΦ╘τïσ╕q5PΦ╦τïσ3└P╕PΦïσ╕╘%P╕£5PΦ▓τïσ╕P╕PΦ⌡ïσ╕╢5PΦ£τïσ3└P╕PΦαïσ╕└%P╕╗5PΦâτïσ╕P╕PΦ╞ïσ╕╢5PΦmτïσ3└P╕
PΦ▒ïσ╕╩%P╕╓5PΦTτïσ╕P╕PΦùïσ╕╢5PΦ>τïσ3└P╕PΦéïσ 6╛%╕±5PΦ%τïσ3└P╕PΦiïσâ>>5uFâ>╛%u╕96PìFnPΦ═Oïσδ╕=6PìFnPΦ╛OïσìFnP╕@6PΦΓµïσ╕P╕PΦ%ïσ╕╢5PΦ╠µïσ╕P╕PΦïσ╕PPìFP╕[6PΦïσ╗Sì^SëFhΦ^ïσìFPΦîOïσ=}╕╘%PìFPΦROïσ╕P╕PΦ╞ïσìFP╕\6PΦiµïσ╕P╕PΦ¼ïσ╕
PìFTP╕[6PΦáïσì^TSëFhΦ6Oïσ=}╕└%PìFTPΦⁿNïσ╕PìFTPΦαïσ╕P╕PΦcïσìFTP╕\6PΦµïσ╕P╕PΦIïσ╕
PìF^P╕[6PΦ=ïσì^^SëFhΦ╙Nïσ=}╕╩%PìF^PΦÖNïσ╕PìF^PΦ}ïσ╕P╕PΦïσìF^P╕\6PΦúσïσâ>>5tΘ~╕P╕PΦ▄ïσ╕PìFnP╕[6PΦ╨ïσì^nSëFhΦfNïσ=}╞FnYâ>╛%t╞FnNèFn0ΣëF@ï≡èä╓:0Σ%tïF- δèFn0ΣêFn0Σ=YëFt=Nt╕PΦ╘√ïσδé3└P╕PΦ_ïσ3└P╕s6PΦCïσà└u╕â─t]├ìFjPìF^PΦ2LïσïFj=z~╗Ö≈√ëFjδφèF0ΣëF@ï≡èä╓:0Σ%tïF δèF0Σï^j;├uà█tΘÿï6@5èB0Σ@ï°èà╓:0Σ%t
èB0Σ- δ ï6@5èB0Σï^j;├uà█ucâ>B5u'3└P╕PΦ«ïσìF^P╕ñ6PΦQΣïσ╕╒6PΦHΣïσΦU8δ-ìFP╕╘%PΦMïσìFTP╕└%PΦ°LïσìF^P╕╩%PΦδLïσ╟╛%╕â─t]├ìFP╕╘%PΦ╨LïσìFTP╕└%PΦ├LïσìF^P╕╩%PΦ╢Lïσ╟╛%èFn0Σ=Yu╟╛%Φ·3└â─t]├Uâ∞ï∞ïF=l~ünlïF
=|=â~|â~â~|â~c~ïv╞╕â─]├ïF
ΘΓ╕≡6PìFPΦ=LïσΘτ╕⌠6PìFPΦ-LïσΘ╫╕°6PìFPΦLïσΘ╟╕ⁿ6PìFPΦLïσΘ╖╕7PìFPΦ²KïσΘº╕7PìFPΦφKïσΘù╕7PìFPΦ▌KïσΘç╕7PìFPΦ═Kïσδx╕7PìFPΦ╛Kïσδi╕7PìFPΦ»KïσδZ╕7PìFPΦáKïσδK╕7PìFPΦæKïσδ<╕ 7PìFPΦéKïσδ-gWwWçWùWºW╖W╟W╫WµW⌡WXXï≡âεrâ■s╤µ. ñ1Xδ─ vìFP v╕$7P vΦ¢Hïσ3└â─]├Uâ∞;&ZwΘ«¿ï∞ïF=l~ünlïF=|=â~
|â~
â~|â~c~ïv╟╕â─]├ïF-P▒ ╙α▒ï^╙π├ï^
├ïvë3└â─]├Uâ∞;&ZwΘ:¿ï∞╟UART_LCR+Async_Base]:=lcr;
Inline ($FB); (* enable interrupts. *)
END; {Async_Change}
(****************************************************************************)
BEGIN {Initialization}
END. {Initialization}