home *** CD-ROM | disk | FTP | other *** search
/ VRML Tools for 3D Cyberspace / VRML_Tools_For_3D_Cyberspace.iso / virtus / vsupport.in_ / vsupport.bin
Text File  |  1996-07-01  |  2KB  |  71 lines

  1. '----------------------------------------------------------------
  2. '- more specialized little functions to make our lives easier.
  3. '- John Alspaugh 27FEB94
  4. '- Copyright 1993-1994 Virtus Corporation.  All Rights Reserved.
  5. '-
  6. '- Note that this must be included after MSDETECT.INC and SETUPAPI.INC
  7. '-
  8. '----------------------------------------------------------------
  9.  
  10.  
  11. DECLARE FUNCTION VSetDriveStatus(pDest$, pControl$) AS INTEGER
  12.  
  13.  
  14.  
  15. '----------------------------------------------------------------
  16. '- Purpose:
  17. '-     Sets drive status info according to latest disk space calcs.
  18. '- Arguments:
  19. '-     none.
  20. '- Returns:
  21. '-     none.
  22. '----------------------------------------------------------------
  23. FUNCTION VSetDriveStatus(pDest$, pControl$) STATIC  AS INTEGER
  24. '$ifdef DEBUG
  25.     if pDest$ = "" then
  26.         BadArgErr 1, "SetDriveStatus", pFName$
  27.     end if
  28.     if pControl$ = "" then
  29.         BadArgErr 2, "SetDriveStatus", pFName$
  30.     end if
  31. '$endif ''DEBUG
  32.  
  33.     drive$ = ucase$(MID$(pDest$, 1, 1))
  34.     cost& = VL_CalcDiskCost(drive$)
  35.     free& = GetFreeSpaceForDrive(drive$)
  36.     ReplaceListItem pControl$, 1, drive$ + ":"
  37.     ReplaceListItem pControl$, 2, STR$(cost& / 1024) + " K"
  38.     ReplaceListItem pControl$, 3, STR$(free& / 1024) + " K"
  39.  
  40.     '' check that the amount of disk space we need is less than the amount available,
  41.     '' and set a flag.
  42.     IF cost& > free& THEN
  43.         state% = 1
  44.     ELSE
  45.         state% = 0
  46.     ENDIF
  47.  
  48.     lWinDrive$ = ucase$(MID$(GetWindowsDir, 1, 1))
  49.     IF drive$ = lWinDrive$ THEN
  50.         ReplaceListItem pControl$, 4, ""
  51.         ReplaceListItem pControl$, 5, ""
  52.         ReplaceListItem pControl$, 6, ""
  53.     ELSE
  54.         cost& = VL_CalcDiskCost(lWinDrive$)
  55.         IF cost& = 0 THEN
  56.             ReplaceListItem pControl$, 4, ""
  57.             ReplaceListItem pControl$, 5, ""
  58.             ReplaceListItem pControl$, 6, ""
  59.         ELSE
  60.             free& = GetFreeSpaceForDrive(lWinDrive$)
  61.             ReplaceListItem pControl$, 4, lWinDrive$ + ":"
  62.             ReplaceListItem pControl$, 5, STR$(cost& / 1024) + " K"
  63.             ReplaceListItem pControl$, 6, STR$(free& / 1024) + " K"
  64.         END IF
  65.     END IF
  66.  
  67.     VSetDriveStatus = state%
  68. END FUNCTION
  69.  
  70.  
  71.