home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP22.EXE / CHP2201.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  778 b   |  33 lines

  1. /*
  2.    Listing 22.1 DOSVER()
  3.    Author: Joe Booth
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. //───── NOTE: must compile with the /N option!
  12.  
  13. #define TEST          // remove if you don't need test code
  14.  
  15. #ifdef TEST           // begin stub test program
  16.  
  17. function test
  18. if Dosver() < 3.1
  19.    ? "Cannot run networked application on this computer"
  20. endif
  21. return nil
  22.  
  23. #endif               // end stub test program
  24.  
  25. function Dosver()
  26. LOCAL cDos := os(),x,nVersion:=0.0
  27. if (x:=at(" ",cDos)) > 0
  28.    nVersion := val(substr(cDos,x+1,99))
  29. endif
  30. return nVersion
  31.  
  32. // end of file CHP2201.PRG
  33.