home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 13 / CD_ASCQ_13_0494.iso / maj / 419 / getser.bas < prev    next >
BASIC Source File  |  1994-03-13  |  879b  |  26 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        PBClone  Copyright (c) 1990-1994  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   +----------------------------------------------------------------------+
  6.  
  7.    DECLARE SUB GetDOSv (MajorVersion%, MinorVersion%)
  8.  
  9.    DECLARE FUNCTION GetSerial00& (BYVAL DriveNr%)
  10.  
  11. FUNCTION GetSerial$(Drive$)
  12.    GetDOSv MajV%, MinV%
  13.    IF MajV% < 4 THEN
  14.       St$ = ""
  15.    ELSE
  16.       IF LEN(Drive$) THEN
  17.          D% = ASC(UCASE$(LEFT$(Drive$, 1))) - 64
  18.       ELSE
  19.          D% = 0
  20.       END IF
  21.       St$ = RIGHT$("00000000" + HEX$(GetSerial00&(D%)), 8)
  22.       St$ = LEFT$(St$, 4) + "-" + RIGHT$(St$, 4)
  23.    END IF
  24.    GetSerial$ = St$
  25. END FUNCTION
  26.