home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / PASCAL / IOSTUFF.ZIP / IOSTUFF.INC < prev    next >
Encoding:
Text File  |  1985-12-28  |  5.0 KB  |  122 lines

  1. INTERFACE;
  2. UNIT IOSTUFF(GetMode,SetMode,CursorSize,CursorOff,PutCursor,FindCursor,
  3.         ClearScreen,ClearLine,ClearEOL,ClearEOP,ClearField,ScrollUp,ScrollDn,
  4.         ScrollField,SetAttr,Writeline,GetStatus,GetDefault,
  5.         ReadSector,WriteSector,GetKey,GetShift,
  6.  
  7.         {Names above are procedures. Names below are data types}
  8.  
  9.         Lines,Columns,Modes,CursorValues,Dirs,TxtType,AttrLen,AttributeTypes,
  10.         BlinkType,ULineType,Normal,Reverse,Hilite,NoDisp,Blink,NoBlink,
  11.         ULine,NoUline,Drive,Track,Head,Sector,SecBuf,BuffAddr);
  12.  
  13. TYPE
  14.      Lines = 1..25;            {Number of lines on screen}
  15.      Columns = 1..80;            {Number of columns on screen}
  16.      Modes = 1..7;            {Video display mode numbers}
  17.      CursorValues = 0..13;        {Max. no. of lines in cursor}
  18.      Dirs = 1..2;            {Scroll directions. 1=Up 2=Down}
  19.      TxtType = LString(81);        {Line of text to be written to screen}
  20.      AttrLen = 1..2000;         {Number of chars to set attrib. byte}
  21.      AttributeTypes = (Normal,Reverse,Hilite,NoDisp);
  22.      BlinkType = (Blink,NoBlink);
  23.      ULineType = (ULine,NoULine);
  24.      Drive = 0..3;
  25.      Track = 0..39;
  26.      Head = 0..1;
  27.      Sector = 1..8;
  28.      SecBuf = Array [0..511] of Byte;    {Buffer used to read sector into}
  29.      BuffAddr = Adrmem;         {Buffer start address}
  30.  
  31. PROCEDURE GetMode(var Mode: Modes);
  32. {Find out what video display is being used and what mode it is in}
  33.  
  34. PROCEDURE SetMode(Mode: Modes);
  35. {Set the video display to the desired mode}
  36.  
  37. PROCEDURE CursorSize(Bottom,Top: CursorValues);
  38. {Set the size of the cursor.  Bottom line is 0, top line is 13.  Monochrome}
  39. {cursor is 13 lines high.  Color mode cursor is 7 lines high max.  Lines   }
  40. {wrap around if they exceed the maximum value.}
  41.  
  42. PROCEDURE CursorOff;
  43. {Turns the cursor off completely.  Can be turned back on with CursorSize.}
  44.  
  45. PROCEDURE PutCursor(Line:Lines; Column:Columns);
  46. {Positions the cursor on the screen at Line,Column.  Line must be in the}
  47. {range 1-25 and Column must be in the range 1-80.}
  48.  
  49. PROCEDURE FindCursor(var Line:Lines; var Column:Columns);
  50. {Locates the cursor and returns the values to the calling routine.}
  51. {Line and column are same range as above.}
  52.  
  53. PROCEDURE ClearScreen;
  54. {Clears the entire screen to blanks.  Leaves the cursor position unchanged.}
  55.  
  56. PROCEDURE ClearLine(Line: Lines);
  57. {Clears one line on the screen.  Procedured is passed the line number (1-25)}
  58. {to be erased.}
  59.  
  60. PROCEDURE ClearEOL;
  61. {Clears from the cursor to the end of the current line.}
  62.  
  63. PROCEDURE ClearEOP;
  64. {Clears the screen from the line following the current cursor line}
  65. {to the bottom of the page.}
  66.  
  67. PROCEDURE ClearField(Line:Lines; Column:Columns; Width:Columns; Height:Lines);
  68. {Will clear to blanks a designated field on the screen .  The procedure is}
  69. {passed the Line and Column of the upper left-hand corner of the field to}
  70. {be cleared, the desired width of the field in columns, and the numer of}
  71. {lines high the field is to be.}
  72.  
  73. PROCEDURE ScrollUp;
  74. {Scrolls the entire screen up one line, replacing the bottom line with}
  75. {a row of blanks.}
  76.  
  77. PROCEDURE ScrollDn;
  78. {Scrolls the entire screen down one line, replacing the top line with}
  79. {a row of blanks.}
  80.  
  81. PROCEDURE ScrollField(Line:Lines; Column:Columns; Width:Columns; Height:Lines;
  82.               Number:Lines; Direction:Dirs);
  83. {Will scroll a designated area of the screen up or down one line.  The}
  84. {procedure is passed the Line and Column of the upper left-hand corner}
  85. {of the field to be scrolled, the desired width in columns, the number}
  86. {of lines high the field is to be and the direction to scroll. }
  87.  
  88. PROCEDURE SetAttr(Line:Lines; Column:Columns; Len:Attrlen; Attr:AttributeTypes;
  89.           ABlink:BlinkType; AUL:UlineType);
  90. {Sets the attribute byte on the screen beginning at Line, Column and}
  91. {continuing for Len characters.  Will set the attribute, blink and underline.}
  92.  
  93. PROCEDURE WriteLine(Line:Lines; Column:Columns; Txt:TxtType);
  94. {Writes a line of text up to 80 characters long on the display beginning}
  95. {at Line, Column.}
  96.  
  97. PROCEDURE GetStatus(var Drv:Drive;var Side:Head;var Trk:Track;var Sect:Sector);
  98. {Interrogates operating system to find out the status of the last disk access.}
  99.  
  100. PROCEDURE GetDefault(var Default:Drive);
  101. {Interrogates operating system to find the current default disk drive.}
  102.  
  103. PROCEDURE ReadSector(Drv:Drive; Side:Head; Trk:Track; Sect:Sector; BufPtr:Adrmem);
  104. {Reads the desired sector directly from a disk, given the Drive number, side}
  105. {of the disk, and track and sector to be read.    Also points to the beginning}
  106. {address of a buffer in which to store the 512 bytes read from disk.}
  107.  
  108. PROCEDURE WriteSector(Drv:Drive; Side:Head; Trk:Track; Sect:Sector; BufPtr:Adrmem);
  109. {Same as above, but writes instead.}
  110.  
  111. PROCEDURE GetKey(var Key:Byte; var Scan:Byte);
  112. {Checks the keyboard buffer and waits for a key to be pressed if none are}
  113. {available.  Returns the value of the key pressed and the scancode.}
  114.  
  115. PROCEDURE GetShift(var Shift:Byte);
  116. {Checks the keyboard to determine the current shift status.  See detailed}
  117. {explanation of shift status in the Technical Reference Manual.}
  118.  
  119. END;
  120.  
  121.  
  122.