home *** CD-ROM | disk | FTP | other *** search
/ RBBS in a Box Volume 1 #2 / RBBS_vol1_no2.iso / add2 / slbbs30b.zip / DOOR.PAS next >
Pascal/Delphi Source File  |  1988-07-04  |  2KB  |  85 lines

  1.  
  2. Program SampleDoor;
  3.  
  4.    { Sample DOOR program to access SLBBS data record }
  5.  
  6. Uses DOS, Crt;
  7.  
  8.  
  9. type SlData = record
  10.  
  11.       PROGID: string[6];                { Program ID } 
  12.  
  13.       carrier: boolean;                 { carrier check enable }
  14.       writeprotect: boolean;            { disk write protection }
  15.       aborttype: byte;                  { 0=no abort, 1=terminate, 2=reboot }
  16.  
  17.       rsactive: boolean;                { set if rs232 active }
  18.       ansi: boolean;                    { user ANSI mode }
  19.       color: boolean;                   { user COLOR mode }
  20.       directvid: boolean;               { system DirectVid mode }
  21.  
  22.       curratt: byte;                    { current video attribute }
  23.       commtype: byte;                   { run parameter }
  24.       idletime: word;                   { idle limit (seconds) }
  25.  
  26.       lastkey: boolean;                 { TRUE = last key from local kbd }
  27.  
  28.       OldVector: array[$00..$FF] of pointer;   { old user int vectors }
  29.  
  30. end;
  31.  
  32.  
  33. var regs: registers;
  34.     data: ^SlData;
  35.     save: pointer;
  36.     c: char;
  37.  
  38.  
  39. Begin
  40.  
  41.   DirectVideo:=False;       { Do all I/O through BIOS }
  42.  
  43.   regs.ah:=$C7;
  44.   MsDos(regs);                  { Load pointer to SLBBS data }
  45.   data:=Ptr(regs.ax,regs.bx);
  46.  
  47.   if data^.progid<>'SLBBS'
  48.     then writeln('Searchlight driver not loaded')
  49.  
  50.   else begin       { display variables }
  51.     writeln;
  52.     writeln('Carrier Check:    ',data^.carrier);
  53.     writeln('Write Protection: ',data^.writeprotect);
  54.     writeln('Direct Video:     ',data^.directvid);
  55.     writeln('Idle Time:        ',data^.idletime);
  56.     writeln;
  57.  
  58.     if data^.rsactive then begin
  59.       writeln('Accessing Original INT10 Address...');
  60.  
  61.       GetIntVec($10,save);                  { read existing address }
  62.       SetIntVec($10,Data^.OldVector[$10]);  { restore original BIOS address }
  63.  
  64.       writeln('This line of output appears on the Local CRT only.');
  65.       writeln;
  66.  
  67.       SetIntVec($10,save);                  { put SLBBS address back }
  68.       writeln('SLBBS Vector Restored.');
  69.       writeln;
  70.     end;
  71.  
  72.     write('Press a key when ready ...');
  73.     while not keypressed do ;
  74.     c:=readkey;
  75.     writeln;
  76.  
  77.     if data^.lastkey
  78.       then writeln(' Key hit came from local keyboard.')
  79.       else writeln(' Key hit came from remote keyboard.');
  80.  
  81.   end;
  82.  
  83. end.
  84. 
  85.