home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 18 / 18.iso / w / w425 / 1.ddi / FNTSETUP.MST < prev    next >
Encoding:
Text File  |  1994-04-05  |  15.7 KB  |  572 lines

  1. '**************************************************************************
  2. '*                       FONT setup application 
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9.  
  10. ''Dialog ID's
  11. CONST ASKQUIT      = 200
  12. CONST DESTPATH     = 300
  13. CONST EXITFAILURE  = 400
  14. CONST EXITQUIT     = 600
  15. CONST EXITSUCCESS  = 700
  16. CONST OPTIONS      = 800
  17. CONST APPHELP      = 900
  18. CONST CUSTINST     = 6200
  19. CONST TOOBIG       = 6300
  20. CONST BADPATH      = 6400
  21.  
  22. ''Bitmap ID
  23. CONST LOGO         = 1
  24.  
  25. ''File Types
  26. ''CONST APPFILES       = 1
  27. CONST OPTFILES1    = 1
  28. CONST OPTFILES2    = 2
  29. CONST OPTFILES3       = 3
  30. CONST OPTFILES4       = 4
  31.  
  32. GLOBAL DEST$        ''Default destination directory.
  33. GLOBAL WINDRIVE$    ''Windows drive letter.
  34. GLOBAL OPT1OPT$     ''Option selection from OptFiles1 option dialog.
  35. GLOBAL OPT2OPT$     ''Option selection from OptFiles2 option dialog.
  36. GLOBAL OPT3OPT$       ''Option selection from OptFiles1 option dialog.
  37. GLOBAL OPT4OPT$       ''Option selection from OptFiles2 option dialog.
  38.  
  39. ''CustInst list symbol names
  40. ''GLOBAL APPNEEDS$    ''Option list costs per drive
  41. GLOBAL OPT1NEEDS$
  42. GLOBAL OPT2NEEDS$
  43. GLOBAL OPT3NEEDS$
  44. GLOBAL OPT4NEEDS$
  45. GLOBAL EXTRACOSTS$  ''List of extra costs to add per drive
  46. GLOBAL BIGLIST$     ''List of option files cost calc results (boolean)
  47.  
  48. ''Dialog list symbol names
  49. GLOBAL CHECKSTATES$
  50. GLOBAL STATUSTEXT$
  51. GLOBAL DRIVETEXT$
  52.  
  53.  
  54. DECLARE SUB AddOptFilesToCopyList (ftype%)
  55. DECLARE SUB RecalcOptFiles (ftype%)
  56. DECLARE SUB RecalcPath
  57. DECLARE SUB SetDriveStatus
  58. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  59.  
  60.  
  61.  
  62. INIT:
  63.     CUIDLL$ = "mscuistf.dll"            ''custom user interface dll
  64.     HELPPROC$ = "FHelpDlgProc"          ''Help dialog procedure
  65.  
  66.     SetBitmap CUIDLL$, LOGO
  67.     SetTitle "╓╨╬─╫╓╠σ░▓╫░│╠╨≥"
  68.  
  69.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  70.     IF szInf$ = "" THEN
  71.         szInf$ = GetSymbolValue("STF_CWDDIR") + "FntSetup.INF"
  72.     END IF
  73.     ReadInfFile szInf$
  74.  
  75.     WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  76.     DEST$ = GetWindowsSysDir()
  77. ''    DEST$ = WINDRIVE$ + DEST$
  78.  
  79.     ''CustInst list symbols
  80.     CHECKSTATES$ = "CheckItemsState"
  81.     STATUSTEXT$  = "StatusItemsText"
  82.     DRIVETEXT$   = "DriveStatusText"
  83.  
  84.     '' generate check boxes
  85.     FOR i% = 1 TO 4 STEP 1
  86.     AddListItem CHECKSTATES$, "ON"
  87.     NEXT i%
  88.  
  89.     '' generate the status line 
  90.     FOR i% = 1 TO 4 STEP 1
  91.         AddListItem STATUSTEXT$, ""
  92.     NEXT i%
  93.  
  94.     FOR i% = 1 TO 7 STEP 1
  95.         AddListItem DRIVETEXT$, ""
  96.     NEXT i%
  97.     ReplaceListItem DRIVETEXT$, 7, DEST$
  98.  
  99.     ''Disk cost list symbols
  100. ''    APPNEEDS$   = "AppNeeds"
  101.     OPT1NEEDS$  = "Opt1Needs"
  102.     OPT2NEEDS$    = "Opt2Needs"
  103.     OPT3NEEDS$    = "Opt3Needs"
  104.     OPT4NEEDS$    = "Opt4Needs"
  105.     EXTRACOSTS$ = "ExtraCosts"
  106.     BIGLIST$    = "BigList"
  107.     FOR i% = 1 TO 4 STEP 1
  108.         AddListItem BIGLIST$, ""
  109.     NEXT i%
  110.     FOR i% = 1 TO 26 STEP 1
  111.         AddListItem EXTRACOSTS$, "0"
  112.     NEXT i%
  113.  
  114.     ''File Option Variables
  115.     OPT1OPT$ = "1"
  116.     OPT2OPT$ = "1"
  117.     OPT3OPT$ = "1"
  118.     OPT4OPT$ = "1"
  119.  
  120.     RecalcPath
  121.     SetDriveStatus
  122.  
  123. '$IFDEF DEBUG
  124.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  125. '$ENDIF ''DEBUG
  126.  
  127.  
  128.  
  129. CUSTINST:
  130.     '' main dialog box message process
  131.     sz$ = UIStartDlg(CUIDLL$, CUSTINST, "FCustInstDlgProc", APPHELP, HELPPROC$)
  132.  
  133.     IF sz$ = "CONTINUE" THEN
  134.         ''Install only if it will fit.
  135.     FOR i% = 1 TO 4 STEP 1
  136.             IF GetListItem(BIGLIST$, i%) <> "" THEN
  137.                 GOSUB TOOBIG
  138.                 GOTO CUSTINST
  139.             END IF
  140.         NEXT i%
  141.         UIPop 1
  142.         GOTO INSTALL
  143.     ELSEIF sz$ = "PATH" THEN
  144.         GOTO GETPATH
  145.     ELSEIF sz$ = "CHK1" THEN
  146.     RecalcOptFiles OPTFILES1
  147.         SetDriveStatus
  148.         GOTO CUSTINST
  149.     ELSEIF sz$ = "CHK2" THEN
  150.     RecalcOptFiles OPTFILES2
  151.         SetDriveStatus
  152.         GOTO CUSTINST
  153.     ELSEIF sz$ = "CHK3" THEN
  154.     RecalcOptFiles OPTFILES3
  155.         SetDriveStatus
  156.     GOTO CUSTINST
  157.     ELSEIF sz$ = "CHK4" THEN
  158.     RecalcOptFiles OPTFILES4
  159.     SetDriveStatus
  160.     GOTO CUSTINST
  161.     ELSEIF sz$ = "REACTIVATE" THEN
  162.         RecalcPath
  163.         SetDriveStatus
  164.         GOTO CUSTINST
  165.     ELSE
  166.         GOSUB ASKQUIT
  167.         GOTO CUSTINST
  168.     END IF
  169.  
  170.  
  171.  
  172. INSTALL:
  173.     ClearCopyList
  174. ''    AddOptFilesToCopyList APPFILES
  175.     AddOptFilesToCopyList OPTFILES1
  176.     AddOptFilesToCopyList OPTFILES2
  177.     AddOptFilesToCopyList OPTFILES3
  178.     AddOptFilesToCopyList OPTFILES4
  179.  
  180.     CreateDir DEST$, cmoNone
  181.     CopyFilesInCopyList
  182.  
  183. ''    IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  184. ''      ini$ = MakePath(DEST$, "DEMO.INI")
  185. ''      CreateIniKeyValue "WIN.INI", "MSSetup Sample 2", "Option1", OPT1OPT$, cmoNone
  186. ''      CreateIniKeyValue ini$, "Section 1", "Key 1", "Value 1" , cmoNone
  187. ''      CreateIniKeyValue ini$, "Section 2", "Key 2", "Value 2" , cmoNone
  188. ''      CreateIniKeyValue ini$, "Section 3", "Key 3", "Value 3" , cmoNone
  189. ''      ini$ = ""
  190. ''    END IF
  191.  
  192. ''    IF GetListItem(CHECKSTATES$, APPFILES) = "ON" THEN
  193. ''     CreateProgmanGroup "MSSetup Sample 2", "", cmoNone
  194. ''     ShowProgmanGroup  "MSSetup Sample 2", 1, cmoNone
  195. ''     CreateProgmanItem "MSSetup Sample 2", "dialogs", "dlgedit.exe "+MakePath(DEST$,"dialogs.res"), "", cmoOverwrite
  196. ''     CreateProgmanItem "MSSetup Sample 2", "dlgprocs.c", "notepad.exe "+MakePath(DEST$,"dlgprocs.c"), "", cmoOverwrite
  197. ''    END IF
  198.  
  199.  
  200. QUIT:
  201.     ON ERROR GOTO ERRQUIT
  202.  
  203.     IF ERR = 0 THEN
  204.         dlg% = EXITSUCCESS
  205.     ELSEIF ERR = STFQUIT THEN
  206.         dlg% = EXITQUIT
  207.     ELSE
  208.         dlg% = EXITFAILURE
  209.     END IF
  210. QUITL1:
  211.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  212.     IF sz$ = "REACTIVATE" THEN
  213.         GOTO QUITL1
  214.     END IF
  215.     UIPop 1
  216.  
  217.     END
  218.  
  219. ERRQUIT:
  220.     i% = DoMsgBox("Setup sources were corrupted, call 555-1212!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  221.     END
  222.  
  223.  
  224.  
  225. GETPATH:
  226.     SetSymbolValue "EditTextIn", DEST$
  227.     SetSymbolValue "EditFocus", "END"
  228. GETPATHL1:
  229.     sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
  230.  
  231.     IF sz$ = "CONTINUE" THEN
  232.         olddest$ = DEST$
  233.         DEST$ = GetSymbolValue("EditTextOut")
  234.  
  235.         ''Validate new path.
  236.         IF IsDirWritable(DEST$) = 0 THEN
  237.             GOSUB BADPATH
  238.             GOTO GETPATHL1
  239.         END IF
  240.         UIPop 1
  241.  
  242.         ''Truncate display if too long.
  243.         IF LEN(DEST$) > 23 THEN
  244.             ReplaceListItem DRIVETEXT$, 7, MID$(DEST$, 1, 23)+"..."
  245.         ELSE
  246.             ReplaceListItem DRIVETEXT$, 7, DEST$
  247.         END IF
  248.  
  249.         ''Recalc if path changed.
  250.         IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
  251.             RecalcPath
  252.             SetDriveStatus
  253.         END IF
  254.  
  255.         olddest$ = ""
  256.         GOTO CUSTINST
  257.     ELSEIF sz$ = "REACTIVATE" THEN
  258.         RecalcPath
  259.         SetDriveStatus
  260.         GOTO GETPATHL1
  261.     ELSEIF sz$ = "EXIT" THEN
  262.         GOSUB ASKQUIT
  263.         GOTO GETPATHL1
  264.     ELSE
  265.         UIPop 1
  266.         GOTO CUSTINST
  267.     END IF
  268.  
  269.  
  270.  
  271. ''OPTFILES1:
  272. ''    SetSymbolValue "RadioDefault", OPT1OPT$
  273. ''OPT1L1:
  274. ''    sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  275. ''    newopt$ = GetSymbolValue("ButtonChecked")
  276.  
  277. ''    IF sz$ = "CONTINUE" THEN
  278. ''      UIPop 1
  279. ''      IF newopt$ <> OPT1OPT$ THEN
  280. ''          OPT1OPT$ = newopt$
  281. ''          RecalcOptFiles OPTFILES1
  282. ''          SetDriveStatus
  283. ''      END IF
  284. ''      newopt$ = ""
  285. ''      GOTO CUSTINST
  286. ''    ELSEIF sz$ = "REACTIVATE" THEN
  287. ''      RecalcPath
  288. ''      SetDriveStatus
  289. ''      GOTO OPT1L1
  290. ''    ELSEIF sz$ = "EXIT" THEN
  291. ''      GOSUB ASKQUIT
  292. ''      GOTO OPT1L1
  293. ''    ELSE
  294. ''      UIPop 1
  295. ''     newopt$ = ""
  296. ''      GOTO CUSTINST
  297. ''    END IF
  298.  
  299.  
  300.  
  301. ''OPTFILES2:
  302. ''    SetSymbolValue "RadioDefault", OPT2OPT$
  303. ''OPT2L1:
  304. ''    sz$ = UIStartDlg(CUIDLL$, OPTIONS, "FRadioDlgProc", APPHELP, HELPPROC$)
  305. ''    newopt$ = GetSymbolValue("ButtonChecked")
  306. ''
  307. ''    IF sz$ = "CONTINUE" THEN
  308. ''      UIPop 1
  309. ''      IF newopt$ <> OPT2OPT$ THEN
  310. ''          OPT2OPT$ = newopt$
  311. ''          RecalcOptFiles OPTFILES2
  312. ''          SetDriveStatus
  313. ''      END IF
  314. ''      newopt$ = ""
  315. ''      GOTO CUSTINST
  316. ''    ELSEIF sz$ = "REACTIVATE" THEN
  317. ''      RecalcPath
  318. ''      SetDriveStatus
  319. ''      GOTO OPT2L1
  320. ''    ELSEIF sz$ = "EXIT" THEN
  321. ''      GOSUB ASKQUIT
  322. ''      GOTO OPT2L1
  323. ''    ELSE
  324. ''      UIPop 1
  325. ''      newopt$ = ""
  326. ''      GOTO CUSTINST
  327. ''    END IF
  328.  
  329.  
  330.  
  331. TOOBIG:
  332.     sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
  333.     IF sz$ = "REACTIVATE" THEN
  334.         RecalcPath
  335.         SetDriveStatus
  336.         GOTO TOOBIG
  337.     END IF
  338.     UIPop 1
  339.     RETURN
  340.  
  341.  
  342.  
  343. BADPATH:
  344.     sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
  345.     IF sz$ = "REACTIVATE" THEN
  346.         RecalcPath
  347.         SetDriveStatus
  348.         GOTO BADPATH
  349.     END IF
  350.     UIPop 1
  351.     RETURN
  352.  
  353.  
  354.  
  355. ASKQUIT:
  356.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  357.  
  358.     IF sz$ = "EXIT" THEN
  359.         UIPopAll
  360.         ERROR STFQUIT
  361.     ELSEIF sz$ = "REACTIVATE" THEN
  362.         GOTO ASKQUIT
  363.     ELSE
  364.         UIPop 1
  365.     END IF
  366.     RETURN
  367.  
  368.  
  369.  
  370. '**
  371. '** Purpose:
  372. '**     Adds the specified option files to the copy list.
  373. '** Arguments:
  374. '**     ftype%  - type of files to add, one of the following:
  375. '**             APPFILES, OPTFILES1, OPTFILES2
  376. '** Returns:
  377. '**     none.
  378. '*************************************************************************
  379. SUB AddOptFilesToCopyList (ftype%) STATIC
  380.  
  381.     IF GetListItem(CHECKSTATES$, ftype%) = "ON" THEN
  382.         SrcDir$ = GetSymbolValue("STF_SRCDIR")
  383. ''    IF ftype% = APPFILES THEN
  384. ''          AddSectionFilesToCopyList "AppFiles", SrcDir$, DEST$
  385.     IF ftype% = OPTFILES1 THEN
  386.           AddSectionKeyFileToCopyList "OptFiles1", OPT1OPT$, SrcDir$, DEST$
  387.     ELSEIF ftype% = OPTFILES2 THEN
  388.           AddSectionKeyFileToCopyList "OptFiles2", OPT2OPT$, SrcDir$, DEST$
  389.     ELSEIF ftype% = OPTFILES3 THEN
  390.           AddSectionKeyFileToCopyList "OptFiles3", OPT3OPT$, SrcDir$, DEST$
  391.     ELSEIF ftype% = OPTFILES4 THEN
  392.           AddSectionKeyFileToCopyList "OptFiles4", OPT4OPT$, SrcDir$, DEST$
  393.         END IF
  394.         SrcDir$ = ""
  395.     END IF
  396. END SUB
  397.  
  398.  
  399. '**
  400. '** Purpose:
  401. '**     Recalculates disk space for the given option files and sets
  402. '**     the status info symbol "StatusItemsText".
  403. '** Arguments:
  404. '**     ftype% - type of files to add, one of the following:
  405. '**             APPFILES, OPTFILES1, OPTFILES2
  406. '** Returns:
  407. '**     none.
  408. '*************************************************************************
  409. SUB RecalcOptFiles (ftype%) STATIC
  410.     CursorSave% = ShowWaitCursor()
  411.     ClearCopyList
  412.     AddOptFilesToCopyList ftype%
  413.  
  414.     '' be changed for FONT 1
  415.     fExtra% = 0
  416.     IF ftype% = OPTFILES1 THEN
  417.     ListSym$ = OPT1NEEDS$
  418.     IF GetListItem(CHECKSTATES$, OPTFILES1) = "ON" THEN
  419.             ''Add extra cost to Windows drive for ini/progman, etc.
  420.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  421.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  422.             fExtra% = 1
  423.         END IF
  424.     END IF
  425.  
  426.     '' be changed for FONT 2
  427.     IF ftype% = OPTFILES2 THEN
  428.     ListSym$ = OPT2NEEDS$
  429.     IF GetListItem(CHECKSTATES$, OPTFILES2) = "ON" THEN
  430.             ''Add extra cost to Windows drive for ini/progman, etc.
  431.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  432.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  433.             fExtra% = 1
  434.         END IF
  435.     END IF
  436.  
  437.     '' be changed for FONT 3
  438.     IF ftype% = OPTFILES3 THEN
  439.     ListSym$ = OPT3NEEDS$
  440.     IF GetListItem(CHECKSTATES$, OPTFILES3) = "ON" THEN
  441.             ''Add extra cost to Windows drive for ini/progman, etc.
  442.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  443.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  444.             fExtra% = 1
  445.         END IF
  446.     END IF
  447.  
  448.     '' be changed for FONT 4
  449.     IF ftype% = OPTFILES4 THEN
  450.     ListSym$ = OPT4NEEDS$
  451.     IF GetListItem(CHECKSTATES$, OPTFILES4) = "ON" THEN
  452.             ''Add extra cost to Windows drive for ini/progman, etc.
  453.             ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  454.             ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
  455.             fExtra% = 1
  456.         END IF
  457.     END IF
  458.  
  459.     StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
  460.  
  461.     cost& = 0
  462.     FOR i% = 1 TO 26 STEP 1
  463.         cost&  = cost& + VAL(GetListItem(ListSym$, i%))
  464.     NEXT i%
  465.     ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
  466.  
  467.     IF StillNeed& > 0 THEN
  468.         ReplaceListItem BIGLIST$, ftype%, "YES"
  469.     ELSE
  470.         ReplaceListItem BIGLIST$, ftype%, ""
  471.     END IF
  472.  
  473.     IF fExtra% THEN
  474.         ReplaceListItem EXTRACOSTS$, ndrive%, "0"
  475.     END IF
  476.     RestoreCursor CursorSave%
  477.     ListSym$ = ""
  478. END SUB
  479.  
  480.  
  481. '**
  482. '** Purpose:
  483. '**     Recalculates disk space and sets option status info according
  484. '**     to the current destination path.
  485. '** Arguments:
  486. '**     none.
  487. '** Returns:
  488. '**     none.
  489. '*************************************************************************
  490. SUB RecalcPath STATIC
  491.  
  492.     CursorSave% = ShowWaitCursor()
  493.  
  494. ''    RecalcOptFiles APPFILES
  495.     RecalcOptFiles OPTFILES1
  496.     RecalcOptFiles OPTFILES2
  497.     RecalcOptFiles OPTFILES3
  498.     RecalcOptFiles OPTFILES4
  499.  
  500.     RestoreCursor CursorSave%
  501. END SUB
  502.  
  503.  
  504. '**
  505. '** Purpose:
  506. '**     Sets drive status info according to latest disk space calcs.
  507. '** Arguments:
  508. '**     none.
  509. '** Returns:
  510. '**     none.
  511. '*************************************************************************
  512. SUB SetDriveStatus STATIC
  513.  
  514.     drive$ = MID$(DEST$, 1, 1)
  515.     ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
  516.  
  517. ''    cost& = VAL(GetListItem(APPNEEDS$, ndrive%))     '' + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  518.  
  519.     '' here be changed for FONTs
  520.     cost& = VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%)) + VAL(GetListItem(OPT3NEEDS$, ndrive%)) + VAL(GetListItem(OPT4NEEDS$, ndrive%))
  521.     free& = GetFreeSpaceForDrive(drive$)
  522.  
  523.     ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
  524.     ReplaceListItem DRIVETEXT$, 2, STR$(cost& / 1024) + " K"
  525.     ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
  526.  
  527.     IF drive$ = WINDRIVE$ THEN
  528.         ReplaceListItem DRIVETEXT$, 4, ""
  529.         ReplaceListItem DRIVETEXT$, 5, ""
  530.         ReplaceListItem DRIVETEXT$, 6, ""
  531.     ELSE
  532.         ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
  533. ''      cost& = VAL(GetListItem(APPNEEDS$, ndrive%)) + VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%))
  534.  
  535.     '' here be changed for FONTs
  536.     cost& = VAL(GetListItem(OPT1NEEDS$, ndrive%)) + VAL(GetListItem(OPT2NEEDS$, ndrive%)) + VAL(GetListItem(OPT3NEEDS$, ndrive%)) + VAL(GetListItem(OPT4NEEDS$, ndrive%))
  537.         IF cost& = 0 THEN
  538.             ReplaceListItem DRIVETEXT$, 4, ""
  539.             ReplaceListItem DRIVETEXT$, 5, ""
  540.             ReplaceListItem DRIVETEXT$, 6, ""
  541.         ELSE
  542.             free& = GetFreeSpaceForDrive(WINDRIVE$)
  543.             ReplaceListItem DRIVETEXT$, 4, WINDRIVE$ + ":"
  544.             ReplaceListItem DRIVETEXT$, 5, STR$(cost& / 1024) + " K"
  545.             ReplaceListItem DRIVETEXT$, 6, STR$(free& / 1024) + " K"
  546.         END IF
  547.     END IF
  548. END SUB
  549.  
  550.  
  551. '**
  552. '** Purpose:
  553. '**     Appends a file name to the end of a directory path,
  554. '**     inserting a backslash character as needed.
  555. '** Arguments:
  556. '**     szDir$  - full directory path (with optional ending "\")
  557. '**     szFile$ - filename to append to directory
  558. '** Returns:
  559. '**     Resulting fully qualified path name.
  560. '*************************************************************************
  561. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  562.     IF szDir$ = "" THEN
  563.         MakePath = szFile$
  564.     ELSEIF szFile$ = "" THEN
  565.         MakePath = szDir$
  566.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  567.         MakePath = szDir$ + szFile$
  568.     ELSE
  569.         MakePath = szDir$ + "\" + szFile$
  570.     END IF
  571. END FUNCTION
  572.