home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPLAN6.ZIP / LANSTAT.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1992-04-07  |  2.8 KB  |  97 lines

  1. {LAN Status sample program for LAN5x.PAS.}
  2.  
  3. uses Crt,
  4.      Dos,
  5.      {use version of LAN50, LAN55, or LAN60 depending on compiler }
  6.      {$ifdef VER50} LAN50;
  7.      {$else}
  8.      {$ifdef VER55} LAN55;
  9.      {$else}
  10.      {$ifdef VER60} LAN60;
  11.      {$endif}
  12.      {$endif}
  13.      {$endif}
  14.  
  15. (**************  GET DOS VERSION NUMBER ***************************)
  16. {The DOS version must be greater than 3.1 to use LAN functions.}
  17. function DosVersionOkay:boolean;
  18. var DosInstalled : real;
  19. begin
  20.   DosInstalled:= hi(dosversion) div 10 +lo(dosversion) / 10;
  21.   writeln('The DOS version is ',DosInstalled:3:2,'.');
  22.   if DosInstalled<3.1 then
  23.     begin
  24.       writeln('The DOS version must be greater than 3.1.');
  25.       DOSVersionOkay:= false;
  26.     end
  27.   else DosVersionOkay:= true;
  28. end;
  29.  
  30. (********************* SHARE STATUS *********************************)
  31. procedure ShowShareStatus;
  32. begin
  33.   write('Share is ');
  34.   if not ShareInstalled then write('not ');
  35.   writeln('installed.');
  36. end;
  37.  
  38. (********************* NETBIOS STATUS *******************************)
  39. procedure ShowNetBIOSstatus;
  40. begin
  41.   write('The INT 2Ah NetBIOS interface is ');
  42.   if not NetBIOSavailable then write('not ');
  43.   writeln('available.');
  44. end;
  45.  
  46. (********************* STATION TYPE *********************************)
  47. procedure ShowStationType;
  48. begin
  49.   write('This station is operating');
  50.   if Server then write(^j^m,'    as a Server');
  51.   if Redirector then write(^j^m,'    as a Redirector');
  52.   if Messenger then write(^j^m,'    as a Messenger');
  53.   if Receiver then write(^j^m,'    as a Receiver');
  54.   writeln('.');
  55.   writeln;
  56. end;
  57.  
  58. (********************* MACHINE NAME *********************************)
  59. procedure ShowMachineName;
  60. begin
  61.   writeln('The machine''s name is ',Machine_name,'.');
  62.   writeln;
  63. end;
  64.  
  65. (********************* REDIRECTION LIST *****************************)
  66. procedure ShowRedirectionList;
  67. begin
  68.   if GetRedirList>0 then
  69.     begin
  70.       FreeRedirList; {paired with GetRedirList above.}
  71.       writeln('The Redirection List is as follows:');
  72.       ShowRedirList;
  73.     end
  74.   else writeln('No devices are redirected.');
  75. end;
  76.  
  77. (********************* MAIN PROGRAM *********************************)
  78. begin
  79.   clrscr;
  80.   writeln('Local Area Network Status Program');
  81.   writeln('------------------------------------------------------------------------');
  82.   if DOSVersionOkay then
  83.     begin
  84.       ShowShareStatus;
  85.       ShowNetBIOSstatus;
  86.       if LANinstalled then
  87.         begin
  88.           ShowStationType;
  89.           ShowMachineName;
  90.           ShowRedirectionList;
  91.         end {if LANinstalled }
  92.       else writeln('This station is operating as a stand-alone PC.')
  93.     end; {of if DosVersionOkay }
  94.   writeln('---------------------------------------------------------------------');
  95.   writeln('End of Local Area Network Status Program.');
  96. end.
  97.