home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / sigmv080.ark / GOTOXY.PSP < prev    next >
Encoding:
Text File  |  1985-02-10  |  1.3 KB  |  32 lines

  1. PROCEDURE GotoXY (X_pos, Y_pos : Integer) ;
  2.  
  3.   { Procedure to position cursor at co-ordinates X,Y for Micro-Term ACT-IV;
  4.       duplicates functions of "GotoXY" in Pascal/M & UCSD.
  5.     Change to proper control codes for your terminal, if necessary.
  6.     Note that to avoid actually printing characters on the screen, the
  7.       numbers are made negative before sending the "character" to the terminal;
  8.       i.e., the range of "X_pos" is actually -128 to -47, rather than 0 to 80,
  9.       and for "Y_pos", -128 to -105, rather than 0 to 23. It's not clear
  10.       whether this is a peculiarity required by Pascal/Z or by the ACT-IV,
  11.       so different strategies may be necessary for different terminals.       }
  12.  
  13.   CONST
  14.     Offset = 128 ;  { Used to reduce X and Y numbers to ranges shown above }
  15.  
  16. BEGIN { GotoXY }
  17.  
  18.   Write (Chr (20)) ; { Signals ACT-IV that position co-ordinates follow }
  19.  
  20.   Write (Chr (Y_pos - Offset)) ; { Send row number first,... }
  21.  
  22.   Write (Chr (X_Pos - Offset)) ; { ...then column number }
  23.  
  24. END { GotoXY } ;
  25.  - Offset)) ; { Send row number first,... }
  26.  
  27.   Write (Chr (X_Pos - Offset)) ; { ...then column numd.              }
  28.  
  29. BEGIN { Ucase }
  30.  
  31.   IF Ord (Letter) IN [Ord ('a')..Ord ('z')] THEN
  32.     Ucase := Chr (Ord (Letter) - Ord ('a') +