home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / mcdsk-32 / _file.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-08-06  |  71.5 KB  |  1,566 lines

  1. VERSION 4.00
  2. Begin VB.Form frmFile 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "File"
  5.    ClientHeight    =   5160
  6.    ClientLeft      =   1485
  7.    ClientTop       =   2415
  8.    ClientWidth     =   7785
  9.    Height          =   5565
  10.    Left            =   1425
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5160
  14.    ScaleWidth      =   7785
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2070
  17.    Width           =   7905
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4425
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7575
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   1
  35.       Top             =   0
  36.       Width           =   7785
  37.       _Version        =   65536
  38.       _ExtentX        =   13732
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   2
  47.          Top             =   90
  48.          Width           =   5100
  49.       End
  50.       Begin Threed.SSCommand cmdNP 
  51.          Height          =   300
  52.          Index           =   1
  53.          Left            =   7455
  54.          TabIndex        =   6
  55.          Top             =   90
  56.          Width           =   255
  57.          _Version        =   65536
  58.          _ExtentX        =   450
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   ">"
  62.          BevelWidth      =   1
  63.          Font3D          =   3
  64.          RoundedCorners  =   0   'False
  65.          Outline         =   0   'False
  66.       End
  67.       Begin Threed.SSCommand cmdNP 
  68.          Height          =   300
  69.          Index           =   0
  70.          Left            =   6615
  71.          TabIndex        =   5
  72.          Top             =   90
  73.          Width           =   255
  74.          _Version        =   65536
  75.          _ExtentX        =   450
  76.          _ExtentY        =   529
  77.          _StockProps     =   78
  78.          Caption         =   "<"
  79.          BevelWidth      =   1
  80.          Font3D          =   3
  81.          RoundedCorners  =   0   'False
  82.          Outline         =   0   'False
  83.       End
  84.       Begin VB.Label Label2 
  85.          Caption         =   "&Select a function"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   4
  89.          Top             =   120
  90.          Width           =   1275
  91.       End
  92.       Begin Threed.SSCommand SSCommand1 
  93.          Default         =   -1  'True
  94.          Height          =   300
  95.          Left            =   6930
  96.          TabIndex        =   3
  97.          Top             =   90
  98.          Width           =   465
  99.          _Version        =   65536
  100.          _ExtentX        =   820
  101.          _ExtentY        =   529
  102.          _StockProps     =   78
  103.          Caption         =   "&Go"
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. Attribute VB_Name = "frmFile"
  110. Attribute VB_Creatable = False
  111. Attribute VB_Exposed = False
  112. Option Explicit
  113. Option Base 1
  114. Private Const Iteration = 10
  115. Dim IsLoaded         As Integer
  116. Dim TimerStartOk     As Single
  117. Private Sub cmdNP_Click(Index As Integer)
  118.    Call sub_NextPrev(cmb_Function, Index)
  119. End Sub
  120. Private Sub cmb_Function_Click()
  121.    If (IsLoaded = False) Then Exit Sub
  122.    mdiMCDSK.Picture1.Visible = True
  123.    mdiMCDSK.Enabled = False
  124.    txt_Result = ""
  125.    DoEvents
  126.    Select Case cmb_Function.ListIndex
  127.       Case 0
  128.          Call TestAllSubDirectories
  129.       Case 1
  130.          Call TestChDir
  131.       Case 2
  132.          Call TestChDrive
  133.       Case 3
  134.          Call TestFileCompressExpandTab
  135.       Case 4
  136.          Call TestFileCopy
  137.       Case 5
  138.          Call TestFileMove
  139.       Case 6
  140.          Call TestFileFilter
  141.       Case 7
  142.          Call TestFileFilterNot
  143.       Case 8
  144.          Call TestFileSize
  145.       Case 9
  146.          Call TestFileLineCount
  147.       Case 10
  148.          Call TestFileUpperLower
  149.       Case 11
  150.          Call TestFileMerge
  151.       Case 12
  152.          Call TestFileSearchAndReplace
  153.       Case 13
  154.          Call TestFileSearch
  155.       Case 14
  156.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, False)
  157.       Case 15
  158.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, False)
  159.       Case 16
  160.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, False)
  161.       Case 17
  162.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, False)
  163.       Case 18
  164.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, True)
  165.       Case 19
  166.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, True)
  167.       Case 20
  168.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, True)
  169.       Case 21
  170.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, True)
  171.       Case 22
  172.          Call TestFileChangeChars
  173.       Case 23
  174.          Call TestIsFileX
  175.       Case 24
  176.          Call TestKillDir
  177.       Case 25
  178.          Call TestKillDirs
  179.       Case 26
  180.          Call TestGetDiskSpace
  181.       Case 27
  182.          Call TestGetDiskUsed
  183.       Case 28
  184.          Call TestGetDiskFree
  185.       Case 29
  186.          Call TestGetDiskClusterSize
  187.       Case 30
  188.          Call TestCountFiles
  189.       Case 31
  190.          Call TestCountDirectories
  191.       Case 32
  192.          Call TestRcsCountFileDir
  193.       Case 33
  194.          Call TestFilesSizeX
  195.       Case 34
  196.          Call TestRcsFilesSizeX
  197.       Case 35
  198.          Call TestTruncatePath
  199.       Case 36
  200.          Call TestMakeSplitPath
  201.       Case 37
  202.          Call TestFullPath
  203.       Case 38
  204.          Call TestRenameFile
  205.       Case 39
  206.          Call TestUniqueFileName
  207.       Case 40
  208.          Call TestFilesInDirectory
  209.       Case 41
  210.          Call TestSubDirectory
  211.       Case 42
  212.          Call TestFileGetAttribute
  213.       Case 43
  214.          Call TestFileSetAttribute
  215.       Case 44
  216.          Call TestFileSetAllAttributes
  217.       Case 45
  218.          Call TestFileResetAllAttributes
  219.       Case 46
  220.          Call TestFileCompareX
  221.       Case 47
  222.          Call TestFileDrive
  223.       Case 48
  224.          Call TestFilesInDirOnDisk
  225.       Case 49
  226.          Call TestFileDateTime
  227.       Case 50
  228.          Call TestFileStatistics
  229.       Case 51
  230.          Call TestGetDriveType
  231.       Case 52
  232.          Call TestFileUUCP
  233.    End Select
  234.    DoEvents
  235.    mdiMCDSK.Enabled = True
  236.    mdiMCDSK.Picture1.Visible = False
  237. End Sub
  238. Private Sub Form_Activate()
  239.    Dim i    As Integer
  240.    i = InStr(mdiMCDSK.Label2.Tag, "~")
  241.    mdiMCDSK.Label2.Caption = Left$(mdiMCDSK.Label2.Tag, i - 1) & Iteration & Mid$(mdiMCDSK.Label2.Tag, i + 1)
  242. End Sub
  243. Private Sub Form_Load()
  244.    IsLoaded = False
  245.    Show
  246.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_file.t2w")
  247.    IsLoaded = True
  248. End Sub
  249. Private Sub SSCommand1_Click()
  250.    Call cmb_Function_Click
  251. End Sub
  252. Private Sub TestAllSubDirectories()
  253.    Dim intResult        As Integer
  254.    Dim strResult        As String
  255.    Dim strDisplay       As String
  256.    Dim i                As Long
  257.    strResult = ""
  258.    strDisplay = ""
  259.    i = -1
  260.    TimerStartOk = Timer
  261.    strResult = cAllSubDirectories("C:", i)
  262.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  263.    'strResult = cStringSAR(strResult, vbCr, vbCrLf, False)
  264.    strDisplay = "Directories founden on drive C are " & i & vbCrLf & vbCrLf & strResult
  265.    txt_Result = strDisplay
  266. End Sub
  267. Private Sub TestChDir()
  268.    Dim intResult        As Integer
  269.    Dim strResult        As String
  270.    Dim strDisplay       As String
  271.    Dim i                As Integer
  272.    strResult = ""
  273.    strDisplay = ""
  274.    For i = 1 To 26
  275.       intResult = cChDir(Chr$(64 + i) & ":\")
  276.       If (intResult = True) Then
  277.          strDisplay = strDisplay & "ChDir to \ on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  278.       End If
  279.    Next i
  280.      
  281.    txt_Result = strDisplay
  282.    'time the function
  283.    TimerStartOk = Timer
  284.    For i = 1 To Iteration
  285.       intResult = cChDir("C:\")
  286.    Next i
  287.    intResult = cChDir(T2WDirTest)
  288.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  289. End Sub
  290. Private Sub TestChDrive()
  291.    Dim intResult        As Integer
  292.    Dim strResult        As String
  293.    Dim strDisplay       As String
  294.    Dim i                As Integer
  295.    strResult = ""
  296.    strDisplay = ""
  297.    For i = 1 To 26
  298.       intResult = cChDrive(Chr$(64 + i))
  299.       If (intResult = True) Then
  300.          strDisplay = strDisplay & "ChDrive on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  301.       End If
  302.    Next i
  303.    txt_Result = strDisplay
  304.    'time the function
  305.    TimerStartOk = Timer
  306.    For i = 1 To Iteration
  307.       intResult = cChDrive("C")
  308.    Next i
  309.    intResult = cChDrive(T2WDirTest)
  310.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  311. End Sub
  312. Private Sub TestFileCompressExpandTab()
  313.    Dim lngResult        As Long
  314.    Dim strResult        As String
  315.    Dim strDisplay       As String
  316.    Dim i                As Long
  317.    Dim File1            As String
  318.    Dim File2            As String
  319.    Dim File3            As String
  320.    strResult = ""
  321.    strDisplay = ""
  322.    File1 = T2WFileTest
  323.    File2 = "autoexec.tabcompressed"
  324.    File3 = "autoexec.tabexpanded"
  325.    For i = 1 To 4
  326.       strDisplay = strDisplay & "File CompressTab (" & i & " spaces = 1 tab) " & File1 & " to " & File2 & " is " & cFileCompressTab(File1, File2, i) & vbCrLf
  327.       strDisplay = strDisplay & "File ExpandTab (" & i & " spaces = 1 tab) " & File2 & " to " & File3 & " is " & cFileExpandTab(File2, File3, i) & vbCrLf
  328.       strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  329.    Next i
  330.    txt_Result = strDisplay
  331.    'time the function
  332.    TimerStartOk = Timer
  333.    For i = 1 To Iteration
  334.       lngResult = cFileExpandTab(File1, File2, 3)
  335.    Next i
  336.    lngResult = cFileCompressTab(File2, File3, 3)
  337.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  338. End Sub
  339. Private Sub TestFileCopy()
  340.    Dim lngResult        As Long
  341.    Dim strResult        As String
  342.    Dim strDisplay       As String
  343.    Dim i                As Long
  344.    Dim File1            As String
  345.    Dim File2            As String
  346.    strResult = ""
  347.    strDisplay = ""
  348.    File1 = T2WFileTest
  349.    File2 = "autoexec.copy"
  350.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  351.    strDisplay = strDisplay & "File Copy2 '" & File1 & "' to '" & File2 & "' is " & cFileCopy2(File1, File2) & vbCrLf & vbCrLf
  352.    txt_Result = strDisplay
  353.    'time the function
  354.    TimerStartOk = Timer
  355.    For i = 1 To Iteration
  356.       lngResult = cFileCopy(File1, File2)
  357.    Next i
  358.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  359. End Sub
  360. Private Sub TestFileMove()
  361.    Dim lngResult        As Long
  362.    Dim strResult        As String
  363.    Dim strDisplay       As String
  364.    Dim i                As Long
  365.    Dim File1            As String
  366.    Dim File2            As String
  367.    strResult = ""
  368.    strDisplay = ""
  369.    File1 = T2WFileTest
  370.    File2 = "c:\win95\autoexec.bat"
  371.    strDisplay = strDisplay & "File Move '" & File1 & "' to '" & File2 & "' is " & cFileMove(File1, File2) & vbCrLf & vbCrLf
  372.    txt_Result = strDisplay
  373.    'time the function
  374.    TimerStartOk = Timer
  375.    For i = 1 To Iteration
  376.       lngResult = cFileMove(File1, File2)
  377.    Next i
  378.    lngResult = cFileCopy(File2, File1)
  379.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  380. End Sub
  381. Private Sub TestFileFilter()
  382.    Dim lngResult        As Long
  383.    Dim strResult        As String
  384.    Dim strDisplay       As String
  385.    Dim i                As Long
  386.    Dim File1            As String
  387.    Dim File2            As String
  388.    Dim Filter           As String
  389.    strResult = ""
  390.    strDisplay = ""
  391.    File1 = T2WFileTest
  392.    File2 = "autoexec.filter"
  393.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  394.    Filter = Filter + LCase$(Filter)
  395.    strDisplay = strDisplay & "File Filter (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  396.    txt_Result = strDisplay
  397.    'time the function
  398.    TimerStartOk = Timer
  399.    For i = 1 To Iteration
  400.       lngResult = cFileFilter(File1, File2, Filter)
  401.    Next i
  402.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  403. End Sub
  404. Private Sub TestFileFilterNot()
  405.    Dim lngResult        As Long
  406.    Dim strResult        As String
  407.    Dim strDisplay       As String
  408.    Dim i                As Long
  409.    Dim File1            As String
  410.    Dim File2            As String
  411.    Dim Filter           As String
  412.    strResult = ""
  413.    strDisplay = ""
  414.    File1 = T2WFileTest
  415.    File2 = "autoexec.filternot"
  416.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  417.    Filter = Filter + LCase$(Filter)
  418.    strDisplay = strDisplay & "File Filter Not (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  419.    txt_Result = strDisplay
  420.    'time the function
  421.    TimerStartOk = Timer
  422.    For i = 1 To Iteration
  423.       lngResult = cFileFilterNot(File1, File2, Filter)
  424.    Next i
  425.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  426. End Sub
  427. Private Sub TestFileSize()
  428.    Dim lngResult        As Long
  429.    Dim strResult        As String
  430.    Dim strDisplay       As String
  431.    Dim i                As Long
  432.    Dim File1            As String
  433.    Dim File2            As String
  434.    strResult = ""
  435.    strDisplay = ""
  436.    File1 = T2WFileTest
  437.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  438.    File1 = "c:\autoexec.bat"
  439.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  440.    File1 = "c:\config.sys"
  441.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  442.    File1 = "c:\test.tst"
  443.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  444.    File1 = "c:\command.com"
  445.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  446.    txt_Result = strDisplay
  447.    'time the function
  448.    TimerStartOk = Timer
  449.    For i = 1 To Iteration
  450.       lngResult = cFileSize(File1)
  451.    Next i
  452.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  453. End Sub
  454. Private Sub TestFileLineCount()
  455.    Dim lngResult        As Long
  456.    Dim strResult        As String
  457.    Dim strDisplay       As String
  458.    Dim i                As Long
  459.    Dim File1            As String
  460.    Dim File2            As String
  461.    strResult = ""
  462.    strDisplay = ""
  463.    File1 = T2WFileTest
  464.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  465.    File1 = "c:\autoexec.bat"
  466.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  467.    File1 = "c:\config.sys"
  468.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  469.    File1 = "c:\test.tst"
  470.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  471.    File1 = "c:\command.com"
  472.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  473.    txt_Result = strDisplay
  474.    'time the function
  475.    TimerStartOk = Timer
  476.    For i = 1 To Iteration
  477.       lngResult = cFileLineCount(File1)
  478.    Next i
  479.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  480. End Sub
  481. Public Sub TestFileUpperLower()
  482.    Dim lngResult        As Long
  483.    Dim strResult        As String
  484.    Dim strDisplay       As String
  485.    Dim i                As Long
  486.    Dim File1            As String
  487.    Dim File2            As String
  488.    Dim File3            As String
  489.    strResult = ""
  490.    strDisplay = ""
  491.    File1 = T2WFileTest
  492.    File2 = "autoexec.toupper"
  493.    File3 = "autoexec.tolower"
  494.    strDisplay = strDisplay & "File to upper '" & File1 & "' to '" & File2 & "' is " & cFileToUpper(File1, File2) & vbCrLf & vbCrLf
  495.    strDisplay = strDisplay & "File to lower '" & File1 & "' to '" & File3 & "' is " & cFileToLower(File1, File3) & vbCrLf & vbCrLf
  496.    txt_Result = strDisplay
  497.    'time the function
  498.    TimerStartOk = Timer
  499.    For i = 1 To Iteration
  500.       lngResult = cFileToUpper(File1, File2)
  501.    Next i
  502.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  503. End Sub
  504. Private Sub TestFileMerge()
  505.    Dim lngResult        As Long
  506.    Dim strResult        As String
  507.    Dim strDisplay       As String
  508.    Dim i                As Long
  509.    Dim File1            As String
  510.    Dim File2            As String
  511.    Dim File3            As String
  512.    strResult = ""
  513.    strDisplay = ""
  514.    File1 = T2WFileTest
  515.    File2 = "c:\config.sys"
  516.    File3 = "autoexec.merged"
  517.    strDisplay = strDisplay & "File Merge '" & File1 & "' and '" & File2 & "' to '" & File3 & "' is " & cFileMerge(File1, File2, File3) & vbCrLf & vbCrLf
  518.    txt_Result = strDisplay
  519.    'time the function
  520.    TimerStartOk = Timer
  521.    For i = 1 To Iteration
  522.       lngResult = cFileMerge(File1, File2, File3)
  523.    Next i
  524.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  525. End Sub
  526. Private Sub TestFileSearchAndReplace()
  527.    Dim lngResult        As Long
  528.    Dim strResult        As String
  529.    Dim strDisplay       As String
  530.    Dim i                As Long
  531.    Dim File1            As String
  532.    Dim File2            As String
  533.    Dim Search           As String
  534.    Dim Replace          As String
  535.    strResult = ""
  536.    strDisplay = ""
  537.    File1 = T2WFileTest
  538.    File2 = "autoexec.searchandreplace"
  539.    Search = "rem SET "
  540.    Replace = "REM set "
  541.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  542.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Search & "' -> '" & Replace & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Search, Replace, "tmp.tmp", True) & vbCrLf & vbCrLf
  543.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Replace & "' -> '" & Search & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Replace, Search, "tmp.tmp", True) & vbCrLf & vbCrLf
  544.    strDisplay = strDisplay & "Compare file contents (insensitive) '" & File2 & "' with '" & File1 & "' is " & IIf(cCmpFileContents(File2, File1, False) = True, "same", "not same") & vbCrLf & vbCrLf
  545.    txt_Result = strDisplay
  546.    'time the function
  547.    TimerStartOk = Timer
  548.    For i = 1 To Iteration
  549.       If ((i Mod 2) = 1) Then
  550.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  551.       Else
  552.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  553.       End If
  554.    Next i
  555.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  556. End Sub
  557. Private Sub TestFileSearch()
  558.    Dim lngResult        As Long
  559.    Dim strResult        As String
  560.    Dim strDisplay       As String
  561.    Dim i                As Long
  562.    Dim File1            As String
  563.    Dim Search1          As String
  564.    Dim Search2          As String
  565.    strResult = ""
  566.    strDisplay = ""
  567.    File1 = T2WFileTest
  568.    Search1 = "re"
  569.    Search2 = "SET"
  570.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, False) & vbCrLf & vbCrLf
  571.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, False) & vbCrLf & vbCrLf
  572.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, False) & vbCrLf & vbCrLf
  573.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, False) & vbCrLf & vbCrLf
  574.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, True) & vbCrLf & vbCrLf
  575.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, True) & vbCrLf & vbCrLf
  576.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, True) & vbCrLf & vbCrLf
  577.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, True) & vbCrLf & vbCrLf
  578.    txt_Result = strDisplay
  579.    'time the function
  580.    TimerStartOk = Timer
  581.    For i = 1 To Iteration
  582.       If ((i Mod 2) = 1) Then
  583.          lngResult = cFileSearch(File1, Search1, False)
  584.       Else
  585.          lngResult = cFileSearchCount(File1, Search2, False)
  586.       End If
  587.    Next i
  588.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  589. End Sub
  590. Private Sub TestFileSort(intSortMethod As Integer, intVarFix As Integer)
  591.    Dim lngResult        As Long
  592.    Dim strResult        As String
  593.    Dim strDisplay       As String
  594.    Dim i                As Long
  595.    Dim n                As Long
  596.    Dim File1            As String
  597.    Dim File2            As String
  598.    strResult = ""
  599.    strDisplay = ""
  600.    File1 = T2WFileTest
  601.    File2 = "autoexec.sort" & intSortMethod & Abs(intVarFix)
  602.    strDisplay = "The 7 first lines in '" & File1 & "' before sorting are " & vbCrLf & vbCrLf
  603.    Close #1
  604.    Open File1 For Input Shared As #1
  605.    For i = 1 To 7
  606.       Line Input #1, strResult
  607.       strDisplay = strDisplay + strResult + vbCrLf
  608.    Next i
  609.    Close #1
  610.    If (intVarFix = False) Then
  611.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  612.    Else
  613.       lngResult = cFileSort(File1, File2, intSortMethod, 7, 0, 7, n)
  614.    End If
  615.    strDisplay = strDisplay + vbCrLf
  616.    strDisplay = strDisplay + "The 7 first lines in '" & File2 & "' after sorting are " & vbCrLf & vbCrLf
  617.    Close #1
  618.    Open File2 For Input Shared As #1
  619.    For i = 1 To 7
  620.       Line Input #1, strResult
  621.       strDisplay = strDisplay + strResult + vbCrLf
  622.    Next i
  623.    Close #1
  624.    strDisplay = strDisplay + vbCrLf
  625.    Select Case intSortMethod
  626.       Case (SORT_ASCENDING + SORT_CASE_SENSITIVE):
  627.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and CS is '" & lngResult & "' and records are '" & n & "'"
  628.       Case (SORT_DESCENDING + SORT_CASE_SENSITIVE):
  629.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and CS is '" & lngResult & "' and records are '" & n & "'"
  630.       Case (SORT_ASCENDING + SORT_CASE_INSENSITIVE):
  631.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and NS is '" & lngResult & "' and records are '" & n & "'"
  632.       Case (SORT_DESCENDING + SORT_CASE_INSENSITIVE):
  633.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and NS is '" & lngResult & "' and records are '" & n & "'"
  634.    End Select
  635.    txt_Result = strDisplay
  636.    'time the function
  637.    TimerStartOk = Timer
  638.    For i = 1 To Iteration
  639.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  640.    Next i
  641.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  642. End Sub
  643. Private Sub TestFileChangeChars()
  644.    Dim lngResult        As Long
  645.    Dim strResult        As String
  646.    Dim strDisplay       As String
  647.    Dim i                As Long
  648.    Dim File1            As String
  649.    Dim File2            As String
  650.    Dim Change1          As String
  651.    Dim Change2          As String
  652.    strResult = ""
  653.    strDisplay = ""
  654.    File1 = T2WFileTest
  655.    File2 = "autoexec.changechars"
  656.    Change1 = "REM"
  657.    Change2 = "mer"
  658.    txt_Result = strDisplay
  659.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  660.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' before change are " & vbCrLf & vbCrLf
  661.    Close #1
  662.    Open File2 For Input Shared As #1
  663.    For i = 1 To 7
  664.       Line Input #1, strResult
  665.       strDisplay = strDisplay + strResult + vbCrLf
  666.    Next i
  667.    Close #1
  668.    strDisplay = strDisplay + vbCrLf
  669.    strDisplay = strDisplay & "File Change Chars : '" & Change1 & "' -> '" & Change2 & "' in '" & File2 & "' is " & cFileChangeChars(File2, Change1, Change2, "file1.file1") & vbCrLf & vbCrLf
  670.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' after change are " & vbCrLf & vbCrLf
  671.    Close #1
  672.    Open File2 For Input Shared As #1
  673.    For i = 1 To 7
  674.       Line Input #1, strResult
  675.       strDisplay = strDisplay + strResult + vbCrLf
  676.    Next i
  677.    Close #1
  678.    txt_Result = strDisplay
  679.    'time the function
  680.    TimerStartOk = Timer
  681.    For i = 1 To Iteration
  682.       If ((i Mod 2) = 1) Then
  683.          lngResult = cFileChangeChars(File2, Change1, Change2, "")
  684.       Else
  685.          lngResult = cFileChangeChars(File2, Change2, Change1, "")
  686.       End If
  687.    Next i
  688.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  689. End Sub
  690. Private Sub TestIsFileX()
  691.    Dim intResult        As Integer
  692.    Dim strResult        As String
  693.    Dim strDisplay       As String
  694.    Dim i                As Integer
  695.    Dim File1            As String
  696.    strResult = ""
  697.    strDisplay = ""
  698.    File1 = T2WFileTest
  699.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  700.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  701.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  702.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  703.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  704.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  705.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  706.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  707.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  708.      
  709.    txt_Result = strDisplay
  710.    'time the function
  711.    TimerStartOk = Timer
  712.    For i = 1 To Iteration
  713.       intResult = cIsFilenameValid(File1)
  714.    Next i
  715.    intResult = cChDir(T2WDirTest)
  716.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  717. End Sub
  718. Private Sub TestKillDir()
  719.    Dim intResult        As Integer
  720.    Dim strResult        As String
  721.    Dim strDisplay       As String
  722.    Dim i                As Integer
  723.    Dim File1            As String
  724.    strResult = ""
  725.    strDisplay = ""
  726.    File1 = "c:\this is a test for KillDir"
  727.    intResult = cMakeDir(File1)
  728.    strDisplay = strDisplay & "Directory '" & File1 & "' is created" & vbCrLf & vbCrLf
  729.    strDisplay = strDisplay & "Directory '" & File1 & "' is " & IIf(cKillDir(File1) = True, "deleted", "not deleted") & vbCrLf & vbCrLf
  730.      
  731.    txt_Result = strDisplay
  732.    'time the function
  733.    TimerStartOk = Timer
  734.    For i = 1 To Iteration
  735.       intResult = cKillDir(File1)
  736.    Next i
  737.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  738. End Sub
  739. Private Sub TestKillDirs()
  740.    Dim intResult        As Integer
  741.    Dim strResult        As String
  742.    Dim strDisplay       As String
  743.    Dim i                As Integer
  744.    Dim File1            As String
  745.    strResult = ""
  746.    strDisplay = ""
  747.    File1 = "c:\this1\this2\this3\this4"
  748.    intResult = cMakeMultipleDir(File1)
  749.    strDisplay = strDisplay & "Directories '" & File1 & "' are created" & vbCrLf & vbCrLf
  750.    strDisplay = strDisplay & "Directories '" & File1 & "' are " & IIf(cKillDirs("c:\this1", True) > 0, "deleted", "not deleted") & vbCrLf & vbCrLf
  751.      
  752.    txt_Result = strDisplay
  753.    'time the function
  754.    TimerStartOk = Timer
  755.    For i = 1 To Iteration
  756.       intResult = cKillDirs(File1, True)
  757.    Next i
  758.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  759. End Sub
  760. Private Sub TestGetDiskSpace()
  761.    Dim lngResult        As Long
  762.    Dim strResult        As String
  763.    Dim strDisplay       As String
  764.    Dim i                As Integer
  765.    strResult = ""
  766.    strDisplay = ""
  767.    For i = 1 To 26
  768.       lngResult = cGetDiskSpace(Chr$(64 + i))
  769.       If (lngResult <> True) Then
  770.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  771.       End If
  772.    Next i
  773.      
  774.    txt_Result = strDisplay
  775.    'time the function
  776.    TimerStartOk = Timer
  777.    For i = 1 To Iteration
  778.       lngResult = cGetDiskSpace("C")
  779.    Next i
  780.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  781. End Sub
  782. Private Sub TestGetDiskUsed()
  783.    Dim lngResult        As Long
  784.    Dim strResult        As String
  785.    Dim strDisplay       As String
  786.    Dim i                As Integer
  787.    strResult = ""
  788.    strDisplay = ""
  789.    For i = 1 To 26
  790.       lngResult = cGetDiskUsed(Chr$(64 + i))
  791.       If (lngResult <> True) Then
  792.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  793.       End If
  794.    Next i
  795.      
  796.    txt_Result = strDisplay
  797.    'time the function
  798.    TimerStartOk = Timer
  799.    For i = 1 To Iteration
  800.       lngResult = cGetDiskUsed("C")
  801.    Next i
  802.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  803. End Sub
  804. Private Sub TestGetDiskFree()
  805.    Dim lngResult        As Long
  806.    Dim strResult        As String
  807.    Dim strDisplay       As String
  808.    Dim i                As Integer
  809.    strResult = ""
  810.    strDisplay = ""
  811.    For i = 1 To 26
  812.       lngResult = cGetDiskFree(Chr$(64 + i))
  813.       If (lngResult <> True) Then
  814.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  815.       End If
  816.    Next i
  817.      
  818.    txt_Result = strDisplay
  819.    'time the function
  820.    TimerStartOk = Timer
  821.    For i = 1 To Iteration
  822.       lngResult = cGetDiskFree("C")
  823.    Next i
  824.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  825. End Sub
  826. Private Sub TestGetDiskClusterSize()
  827.    Dim lngResult        As Long
  828.    Dim strResult        As String
  829.    Dim strDisplay       As String
  830.    Dim i                As Integer
  831.    strResult = ""
  832.    strDisplay = ""
  833.    For i = 1 To 26
  834.       lngResult = cGetDiskClusterSize(Chr$(64 + i))
  835.       If (lngResult <> True) Then
  836.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  837.       End If
  838.    Next i
  839.      
  840.    txt_Result = strDisplay
  841.    'time the function
  842.    TimerStartOk = Timer
  843.    For i = 1 To Iteration
  844.       lngResult = cGetDiskClusterSize("C")
  845.    Next i
  846.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  847. End Sub
  848. Private Sub TestRcsCountFileDir()
  849.    Dim lngResult        As Long
  850.    Dim strResult        As String
  851.    Dim strDisplay       As String
  852.    Dim i                As Integer
  853.    strResult = ""
  854.    strDisplay = ""
  855.    strDisplay = strDisplay & "Total directories in C: is " & cRcsCountFileDir(False, "C:", "", True) & vbCrLf
  856.    strDisplay = strDisplay & "Total directories in D: is " & cRcsCountFileDir(False, "D:", "", True) & vbCrLf
  857.    strDisplay = strDisplay & vbCrLf
  858.    strDisplay = strDisplay & "Total files in C: is " & cRcsCountFileDir(True, "C:", "", True) & vbCrLf
  859.    strDisplay = strDisplay & "Total files in D: is " & cRcsCountFileDir(True, "D:", "", True) & vbCrLf
  860.    strDisplay = strDisplay & vbCrLf
  861.    strDisplay = strDisplay & "Total files in C:*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", True) & vbCrLf
  862.    strDisplay = strDisplay & "Total files in D:*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", True) & vbCrLf
  863.    strDisplay = strDisplay & vbCrLf
  864.    strDisplay = strDisplay & "Total directories in C:\ is " & cRcsCountFileDir(False, "C:", "", False) & vbCrLf
  865.    strDisplay = strDisplay & "Total directories in D:\ is " & cRcsCountFileDir(False, "D:", "", False) & vbCrLf
  866.    strDisplay = strDisplay & vbCrLf
  867.    strDisplay = strDisplay & "Total files in C:\ is " & cRcsCountFileDir(True, "C:", "", False) & vbCrLf
  868.    strDisplay = strDisplay & "Total files in D:\ is " & cRcsCountFileDir(True, "D:", "", False) & vbCrLf
  869.    strDisplay = strDisplay & vbCrLf
  870.    strDisplay = strDisplay & "Total files in C:\*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", False) & vbCrLf
  871.    strDisplay = strDisplay & "Total files in D:\*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", False) & vbCrLf
  872.    txt_Result = strDisplay
  873.    'time the function
  874.    TimerStartOk = Timer
  875.    For i = 1 To Iteration
  876.       lngResult = cRcsCountFileDir(False, "C:", "", False)
  877.    Next i
  878.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  879. End Sub
  880. Private Sub TestCountFiles()
  881.    Dim lngResult        As Long
  882.    Dim strResult        As String
  883.    Dim strDisplay       As String
  884.    Dim i                As Integer
  885.    strResult = ""
  886.    strDisplay = ""
  887.    strDisplay = strDisplay & "Number of files in C:\ is " & cCountFiles("C:\*.*") & vbCrLf & vbCrLf
  888.    strDisplay = strDisplay & "Number of files in D:\ is " & cCountFiles("D:\*.*") & vbCrLf & vbCrLf
  889.    strDisplay = strDisplay & "Number of files in E:\ is " & cCountFiles("E:\*.*") & vbCrLf & vbCrLf
  890.    txt_Result = strDisplay
  891.    'time the function
  892.    TimerStartOk = Timer
  893.    For i = 1 To Iteration
  894.       lngResult = cCountFiles("C:\*.*")
  895.    Next i
  896.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  897. End Sub
  898. Private Sub TestCountDirectories()
  899.    Dim lngResult        As Long
  900.    Dim strResult        As String
  901.    Dim strDisplay       As String
  902.    Dim i                As Integer
  903.    strResult = ""
  904.    strDisplay = ""
  905.    strDisplay = strDisplay & "Number of directories in C:\ is " & cCountDirectories("C:\*.*") & vbCrLf & vbCrLf
  906.    strDisplay = strDisplay & "Number of directories in D:\ is " & cCountDirectories("D:\*.*") & vbCrLf & vbCrLf
  907.    strDisplay = strDisplay & "Number of directories in E:\ is " & cCountDirectories("E:\*.*") & vbCrLf & vbCrLf
  908.    txt_Result = strDisplay
  909.    'time the function
  910.    TimerStartOk = Timer
  911.    For i = 1 To Iteration
  912.       lngResult = cCountDirectories("C:\*.*")
  913.    Next i
  914.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  915. End Sub
  916. Private Sub TestFilesSizeX()
  917.    Dim lngResult        As Long
  918.    Dim strResult        As String
  919.    Dim strDisplay       As String
  920.    Dim i                As Long
  921.    Dim Size1            As Double
  922.    Dim Size2            As Double
  923.    strResult = ""
  924.    strDisplay = ""
  925.    strDisplay = strDisplay & "Size of files c:\*.* is " & cFilesSize("c:\*.*") & vbCrLf
  926.    strDisplay = strDisplay & "Size of files c:\*.bat is " & cFilesSize("c:\*.bat") & vbCrLf
  927.    strDisplay = strDisplay & "Size of files c:\*.sys is " & cFilesSize("c:\*.sys") & vbCrLf
  928.    strDisplay = strDisplay & "Size of files c:\*.com is " & cFilesSize("c:\*.com") & vbCrLf
  929.    strDisplay = strDisplay & vbCrLf
  930.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cFilesSizeOnDisk("c:\*.*") & vbCrLf
  931.    strDisplay = strDisplay & "Size of files c:\*.bat on disk is " & cFilesSizeOnDisk("c:\*.bat") & vbCrLf
  932.    strDisplay = strDisplay & "Size of files c:\*.sys on disk is " & cFilesSizeOnDisk("c:\*.sys") & vbCrLf
  933.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cFilesSizeOnDisk("c:\*.com") & vbCrLf
  934.    strDisplay = strDisplay & vbCrLf
  935.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cFilesSlack("c:\*.*", Size1, Size2) & " %" & vbCrLf
  936.    strDisplay = strDisplay & "Slack of files c:\*.bat on disk is " & cFilesSlack("c:\*.bat", Size1, Size2) & " %" & vbCrLf
  937.    strDisplay = strDisplay & "Slack of files c:\*.sys on disk is " & cFilesSlack("c:\*.sys", Size1, Size2) & " %" & vbCrLf
  938.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cFilesSlack("c:\*.com", Size1, Size2) & " %" & vbCrLf
  939.    txt_Result = strDisplay
  940.    'time the function
  941.    TimerStartOk = Timer
  942.    For i = 1 To Iteration
  943.       lngResult = cFilesSize("c:\*.*")
  944.    Next i
  945.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  946. End Sub
  947. Private Sub TestRcsFilesSizeX()
  948.    Dim lngResult        As Long
  949.    Dim strResult        As String
  950.    Dim strDisplay       As String
  951.    Dim i                As Long
  952.    Dim Size1            As Double
  953.    Dim Size2            As Double
  954.    strResult = ""
  955.    strDisplay = ""
  956.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", False) & vbCrLf
  957.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", False) & vbCrLf
  958.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", False) & vbCrLf
  959.    strDisplay = strDisplay & vbCrLf
  960.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", False) & vbCrLf
  961.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", False) & vbCrLf
  962.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", False) & vbCrLf
  963.    strDisplay = strDisplay & vbCrLf
  964.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", False, Size1, Size2) & " %" & vbCrLf
  965.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", False, Size1, Size2) & " %" & vbCrLf
  966.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", False, Size1, Size2) & " %" & vbCrLf
  967.    strDisplay = strDisplay & vbCrLf
  968.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", True) & vbCrLf
  969.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", True) & vbCrLf
  970.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", True) & vbCrLf
  971.    strDisplay = strDisplay & vbCrLf
  972.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", True) & vbCrLf
  973.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", True) & vbCrLf
  974.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", True) & vbCrLf
  975.    strDisplay = strDisplay & vbCrLf
  976.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", True, Size1, Size2) & " %" & vbCrLf
  977.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", True, Size1, Size2) & " %" & vbCrLf
  978.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", True, Size1, Size2) & " %" & vbCrLf
  979.    txt_Result = strDisplay
  980.    'time the function
  981.    TimerStartOk = Timer
  982.    For i = 1 To Iteration
  983.       lngResult = cRcsFilesSize("c:\", "*.*", False)
  984.    Next i
  985.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  986. End Sub
  987. Private Sub TestTruncatePath()
  988.    Dim intResult        As Integer
  989.    Dim strResult        As String
  990.    Dim strDisplay       As String
  991.    Dim i                As Integer
  992.    Dim File1            As String
  993.    strResult = ""
  994.    strDisplay = ""
  995.    strDisplay = strDisplay & "Truncate the following path with a length of 25" & vbCrLf & vbCrLf
  996.    File1 = "t2win-16.bas"
  997.    strResult = cTruncatePath(File1, 25)
  998.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  999.    File1 = "windows\system\t2win-16.bas"
  1000.    strResult = cTruncatePath(File1, 25)
  1001.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1002.    File1 = "c:\win95\system\t2win-16.bas"
  1003.    strResult = cTruncatePath(File1, 25)
  1004.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1005.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1006.    strResult = cTruncatePath(File1, 25)
  1007.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1008.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1009.    strResult = cTruncatePath(File1, 25)
  1010.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1011.    strDisplay = strDisplay & "Truncate the following path with a length of 35" & vbCrLf & vbCrLf
  1012.    File1 = "t2win-16.bas"
  1013.    strResult = cTruncatePath(File1, 35)
  1014.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1015.    File1 = "windows\system\t2win-16.bas"
  1016.    strResult = cTruncatePath(File1, 35)
  1017.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1018.    File1 = "c:\win95\system\t2win-16.bas"
  1019.    strResult = cTruncatePath(File1, 35)
  1020.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1021.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1022.    strResult = cTruncatePath(File1, 35)
  1023.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1024.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1025.    strResult = cTruncatePath(File1, 35)
  1026.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1027.      
  1028.    txt_Result = strDisplay
  1029.    'time the function
  1030.    TimerStartOk = Timer
  1031.    For i = 1 To Iteration
  1032.       strResult = cTruncatePath(File1, 35)
  1033.    Next i
  1034.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1035. End Sub
  1036. Private Sub TestMakeSplitPath()
  1037.    Dim intResult        As Integer
  1038.    Dim strResult        As String
  1039.    Dim strDisplay       As String
  1040.    Dim i                As Integer
  1041.    Dim SPLITPATH        As tagSPLITPATH
  1042.    Dim File1            As String
  1043.    strResult = ""
  1044.    strDisplay = ""
  1045.    File1 = cMakePath("c", "\this is a test", "test", "dat")
  1046.    strDisplay = strDisplay & "Make Path of (c,\this is a test,test,dat) is '" & File1 & "'" & vbCrLf & vbCrLf
  1047.    strDisplay = strDisplay & "Split Path '" & File1 & "' into four components is :" & vbCrLf & vbCrLf
  1048.    intResult = cSplitPath(File1, SPLITPATH)
  1049.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDrive & vbCrLf
  1050.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDir & vbCrLf
  1051.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nName & vbCrLf
  1052.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nExt & vbCrLf & vbCrLf
  1053.    txt_Result = strDisplay
  1054.    'time the function
  1055.    TimerStartOk = Timer
  1056.    For i = 1 To Iteration
  1057.       strResult = cMakePath("c", "this is a test", "test", "dat")
  1058.    Next i
  1059.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1060. End Sub
  1061. Private Sub TestFullPath()
  1062.    Dim intResult        As Integer
  1063.    Dim strResult        As String
  1064.    Dim strDisplay       As String
  1065.    Dim i                As Integer
  1066.    Dim File1            As String
  1067.    strResult = ""
  1068.    strDisplay = ""
  1069.    File1 = T2WFileTest
  1070.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1071.    txt_Result = strDisplay
  1072.    'time the function
  1073.    TimerStartOk = Timer
  1074.    For i = 1 To Iteration
  1075.       strResult = cFullPath(File1)
  1076.    Next i
  1077.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1078. End Sub
  1079. Private Sub TestRenameFile()
  1080.    Dim intResult        As Integer
  1081.    Dim strResult        As String
  1082.    Dim strDisplay       As String
  1083.    Dim i                As Integer
  1084.    Dim File1            As String
  1085.    Dim File2            As String
  1086.    strResult = ""
  1087.    strDisplay = ""
  1088.    File1 = "this.is.a.test.~~~"
  1089.    File2 = "an another test.---"
  1090.    intResult = cKillFile(File1)
  1091.    intResult = cKillFile(File2)
  1092.    Close #1
  1093.    Open File1 For Output Shared As #1
  1094.    Print #1, File1
  1095.    Print #1, File2
  1096.    Close #1
  1097.    strDisplay = "File '" & File1 & "' " & IIf(cRenameFile(File1, File2) = True, "renamed in '" & File2 & "'", "is not renamed") & vbCrLf & vbCrLf
  1098.    txt_Result = strDisplay
  1099.    'time the function
  1100.    TimerStartOk = Timer
  1101.    For i = 1 To Iteration
  1102.       intResult = cRenameFile(File1, File2)
  1103.    Next i
  1104.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1105. End Sub
  1106. Public Sub TestUniqueFileName()
  1107.    Dim intResult        As Integer
  1108.    Dim strResult        As String
  1109.    Dim strDisplay       As String
  1110.    Dim i                As Integer
  1111.    Dim File1            As String
  1112.    strResult = ""
  1113.    strDisplay = ""
  1114.    File1 = "WN"
  1115.    strDisplay = strDisplay + "Generate unique filename with template '" & File1 & "' is '" & cUniqueFileName(File1) & "'" & vbCrLf & vbCrLf
  1116.    txt_Result = strDisplay
  1117.    'time the function
  1118.    TimerStartOk = Timer
  1119.    For i = 1 To Iteration
  1120.       strResult = cUniqueFileName(File1)
  1121.    Next i
  1122.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1123. End Sub
  1124. Private Sub TestFilesInDirectory()
  1125.    Dim intResult        As Integer
  1126.    Dim strResult        As String
  1127.    Dim strDisplay       As String
  1128.    Dim i                As Integer
  1129.    Dim File1            As String
  1130.    strResult = ""
  1131.    strDisplay = ""
  1132.    File1 = "*.*"
  1133.    strDisplay = strDisplay + "The 10 first files in the current directory" & vbCrLf & vbCrLf
  1134.    strResult = cFilesInDirectory(File1, True)
  1135.    For i = 1 To 10
  1136.       strDisplay = strDisplay & strResult & vbCrLf
  1137.       strResult = cFilesInDirectory(File1, False)
  1138.    Next i
  1139.    strDisplay = strDisplay + vbCrLf
  1140.    File1 = "C:\*.*"
  1141.    strDisplay = strDisplay + "The 10 first files in '" & File1 & "'" & vbCrLf & vbCrLf
  1142.    strResult = cFilesInDirectory(File1, True)
  1143.    For i = 1 To 10
  1144.       strDisplay = strDisplay & strResult & vbCrLf
  1145.       strResult = cFilesInDirectory(File1, False)
  1146.    Next i
  1147.    txt_Result = strDisplay
  1148.    'time the function
  1149.    TimerStartOk = Timer
  1150.    For i = 1 To Iteration
  1151.       strResult = cFilesInDirectory(File1, True)
  1152.    Next i
  1153.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1154. End Sub
  1155. Private Sub TestSubDirectory()
  1156.    Dim intResult        As Integer
  1157.    Dim strResult        As String
  1158.    Dim strDisplay       As String
  1159.    Dim i                As Integer
  1160.    Dim File1            As String
  1161.    strResult = ""
  1162.    strDisplay = ""
  1163.    File1 = "*.*"
  1164.    strDisplay = strDisplay + "The 10 first directory in the current directory" & vbCrLf & vbCrLf
  1165.    strResult = cSubDirectory(File1, True)
  1166.    For i = 1 To 10
  1167.       strDisplay = strDisplay & strResult & vbCrLf
  1168.       strResult = cSubDirectory(File1, False)
  1169.    Next i
  1170.    strDisplay = strDisplay + vbCrLf
  1171.    File1 = "C:\*.*"
  1172.    strDisplay = strDisplay + "The 10 first directory in '" & File1 & "'" & vbCrLf & vbCrLf
  1173.    strResult = cSubDirectory(File1, True)
  1174.    For i = 1 To 10
  1175.       strDisplay = strDisplay & strResult & vbCrLf
  1176.       strResult = cSubDirectory(File1, False)
  1177.    Next i
  1178.    txt_Result = strDisplay
  1179.    'time the function
  1180.    TimerStartOk = Timer
  1181.    For i = 1 To Iteration
  1182.       strResult = cSubDirectory(File1, True)
  1183.    Next i
  1184.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1185. End Sub
  1186. Private Sub TestFileGetAttribute()
  1187.    Dim intResult        As Integer
  1188.    Dim strResult        As String
  1189.    Dim strDisplay       As String
  1190.    Dim i                As Integer
  1191.    Dim File1            As String
  1192.    Dim FileAttrib       As FileAttributeType
  1193.    strResult = ""
  1194.    strDisplay = ""
  1195.    File1 = cFilesInDirectory("*.*", True)
  1196.    intResult = cFileGetAttrib(File1, FileAttrib)
  1197.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1198.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1199.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1200.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1201.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1202.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1203.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1204.      
  1205.    File1 = cSubDirectory("c:\*.*", True)
  1206.    File1 = cSubDirectory("c:\*.*", False)
  1207.    File1 = cSubDirectory("c:\*.*", False)
  1208.    File1 = "c:\" & File1
  1209.    intResult = cFileGetAttrib(File1, FileAttrib)
  1210.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1211.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1212.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1213.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1214.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1215.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1216.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1217.      
  1218.    txt_Result = strDisplay
  1219.    'time the function
  1220.    TimerStartOk = Timer
  1221.    For i = 1 To Iteration
  1222.       intResult = cFileGetAttrib(File1, FileAttrib)
  1223.    Next i
  1224.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1225. End Sub
  1226. Private Sub TestFileSetAttribute()
  1227.    Dim intResult        As Integer
  1228.    Dim strResult        As String
  1229.    Dim strDisplay       As String
  1230.    Dim i                As Integer
  1231.    Dim File1            As String
  1232.    Dim FileAttrib       As FileAttributeType
  1233.    strResult = ""
  1234.    strDisplay = ""
  1235.    File1 = cFilesInDirectory("*.*", True)
  1236.    intResult = cFileGetAttrib(File1, FileAttrib)
  1237.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1238.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1239.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1240.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1241.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1242.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1243.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1244.    FileAttrib.Archive = False
  1245.    FileAttrib.Hidden = True
  1246.    FileAttrib.ReadOnly = True
  1247.    FileAttrib.System = True
  1248.    intResult = cFileSetAttrib(File1, FileAttrib)
  1249.    strDisplay = strDisplay & "Setting attribute (not archive, hidden, readonly, system) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1250.      
  1251.    intResult = cFileGetAttrib(File1, FileAttrib)
  1252.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1253.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1254.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1255.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1256.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1257.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1258.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1259.    txt_Result = strDisplay
  1260.    'time the function
  1261.    TimerStartOk = Timer
  1262.    For i = 1 To Iteration
  1263.       intResult = cFileSetAttrib(File1, FileAttrib)
  1264.    Next i
  1265.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1266. End Sub
  1267. Private Sub TestFileSetAllAttributes()
  1268.    Dim intResult        As Integer
  1269.    Dim strResult        As String
  1270.    Dim strDisplay       As String
  1271.    Dim i                As Integer
  1272.    Dim File1            As String
  1273.    Dim FileAttrib       As FileAttributeType
  1274.    strResult = ""
  1275.    strDisplay = ""
  1276.    File1 = cFilesInDirectory("*.*", True)
  1277.    intResult = cFileGetAttrib(File1, FileAttrib)
  1278.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1279.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1280.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1281.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1282.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1283.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1284.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1285.    intResult = cFileSetAllAttrib(File1)
  1286.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1287.      
  1288.    intResult = cFileGetAttrib(File1, FileAttrib)
  1289.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1290.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1291.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1292.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1293.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1294.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1295.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1296.    txt_Result = strDisplay
  1297.    'time the function
  1298.    TimerStartOk = Timer
  1299.    For i = 1 To Iteration
  1300.       intResult = cFileSetAllAttrib(File1)
  1301.    Next i
  1302.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1303. End Sub
  1304. Public Sub TestFileResetAllAttributes()
  1305.    Dim intResult        As Integer
  1306.    Dim strResult        As String
  1307.    Dim strDisplay       As String
  1308.    Dim i                As Integer
  1309.    Dim File1            As String
  1310.    Dim FileAttrib       As FileAttributeType
  1311.    strResult = ""
  1312.    strDisplay = ""
  1313.    File1 = cFilesInDirectory("*.*", True)
  1314.    intResult = cFileGetAttrib(File1, FileAttrib)
  1315.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1316.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1317.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1318.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1319.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1320.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1321.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1322.    intResult = cFileResetAllAttrib(File1)
  1323.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1324.      
  1325.    intResult = cFileGetAttrib(File1, FileAttrib)
  1326.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1327.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1328.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1329.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1330.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1331.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1332.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1333.    txt_Result = strDisplay
  1334.    'time the function
  1335.    TimerStartOk = Timer
  1336.    For i = 1 To Iteration
  1337.       intResult = cFileResetAllAttrib(File1)
  1338.    Next i
  1339.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1340. End Sub
  1341. Public Sub TestFileCompareX()
  1342.    Dim intResult        As Integer
  1343.    Dim strResult        As String
  1344.    Dim strDisplay       As String
  1345.    Dim i                As Integer
  1346.    Dim File1            As String
  1347.    Dim File2            As String
  1348.    Dim FileAttrib       As FileAttributeType
  1349.    strResult = ""
  1350.    strDisplay = ""
  1351.    File1 = T2WFileTest
  1352.    File2 = "autoexec.compare"
  1353.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  1354.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1355.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1356.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1357.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1358.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1359.      
  1360.    Close #1
  1361.    Open File2 For Append Shared As #1
  1362.    Print #1, File2
  1363.    Close #1
  1364.      
  1365.    strDisplay = strDisplay & "Appending " & (Len(File2) + 2) & " chars to '" & File2 & "'" & vbCrLf & vbCrLf
  1366.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1367.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1368.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1369.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1370.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1371.      
  1372.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) is " & cFileResetAllAttrib(File2) & vbCrLf & vbCrLf
  1373.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  1374.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  1375.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  1376.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  1377.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  1378.      
  1379.    txt_Result = strDisplay
  1380.    'time the function
  1381.    TimerStartOk = Timer
  1382.    For i = 1 To Iteration
  1383.       intResult = cCmpFileSize(File1, File2)
  1384.    Next i
  1385.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1386. End Sub
  1387. Private Sub TestFileDrive()
  1388.    Dim intResult        As Integer
  1389.    Dim strResult        As String
  1390.    Dim strDisplay       As String
  1391.    Dim i                As Integer
  1392.    Dim File1            As String
  1393.    strResult = ""
  1394.    strDisplay = ""
  1395.    File1 = T2WFileTest
  1396.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  1397.    txt_Result = strDisplay
  1398.    'time the function
  1399.    TimerStartOk = Timer
  1400.    For i = 1 To Iteration
  1401.       strResult = cFileDrive(File1)
  1402.    Next i
  1403.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1404. End Sub
  1405. Private Sub TestFilesInDirOnDisk()
  1406.    Dim lngResult        As Long
  1407.    Dim strResult        As String
  1408.    Dim strDisplay       As String
  1409.    Dim i                As Integer
  1410.    Dim File1            As String
  1411.    Dim File2            As String
  1412.    strResult = ""
  1413.    strDisplay = ""
  1414.    File1 = "filesindirondisk.temp"
  1415.    File2 = "c:\*.*"
  1416.    strDisplay = strDisplay & "Number of files '" & File2 & "' (with at least one of the following attribute)" & vbCrLf & vbCrLf
  1417.    strDisplay = strDisplay & "Any : " & cFilesInDirOnDisk(File1, File2, A_ALL) & vbCrLf
  1418.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL) & vbCrLf
  1419.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL_ARCHIVE) & vbCrLf
  1420.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE) & vbCrLf
  1421.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE Or A_RDONLY) & vbCrLf
  1422.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_SYSTEM Or A_HIDDEN Or A_RDONLY) & vbCrLf
  1423.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_HIDDEN Or A_RDONLY) & vbCrLf
  1424.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_RDONLY) & vbCrLf
  1425.    strDisplay = strDisplay & vbCrLf
  1426.    strDisplay = strDisplay & "Number of files in '" & File2 & "' (with exact attribute excluding all others)" & vbCrLf & vbCrLf
  1427.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL)) & vbCrLf
  1428.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL_ARCHIVE)) & vbCrLf
  1429.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE)) & vbCrLf
  1430.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE Or A_RDONLY)) & vbCrLf
  1431.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  1432.    strDisplay = strDisplay & "(A)rchive, (S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL Or A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  1433.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_HIDDEN Or A_RDONLY)) & vbCrLf
  1434.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_RDONLY)) & vbCrLf
  1435.    strDisplay = strDisplay & vbCrLf
  1436.    txt_Result = strDisplay
  1437.    'time the function
  1438.    TimerStartOk = Timer
  1439.    For i = 1 To Iteration
  1440.       lngResult = cFilesInDirOnDisk(File1, File2, A_ALL)
  1441.    Next i
  1442.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1443. End Sub
  1444. Private Sub TestFileDateTime()
  1445.    Dim intResult        As Integer
  1446.    Dim strResult        As String
  1447.    Dim strDisplay       As String
  1448.    Dim i                As Integer
  1449.    Dim File1            As String
  1450.    strResult = ""
  1451.    strDisplay = ""
  1452.    File1 = T2WFileTest
  1453.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1454.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1455.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1456.    File1 = "c:\config.sys"
  1457.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  1458.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  1459.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  1460.    txt_Result = strDisplay
  1461.    'time the function
  1462.    TimerStartOk = Timer
  1463.    For i = 1 To Iteration
  1464.       strResult = cFileDateCreated(File1)
  1465.    Next i
  1466.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1467. End Sub
  1468. Private Sub TestFileStatistics()
  1469.    Dim lngResult        As Long
  1470.    Dim strResult        As String
  1471.    Dim strDisplay       As String
  1472.    Dim i                As Integer
  1473.    Dim nL               As Long
  1474.    Dim nW               As Long
  1475.    Dim nC               As Long
  1476.    Dim File1            As String
  1477.    strResult = ""
  1478.    strDisplay = ""
  1479.    File1 = T2WFileTest
  1480.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  1481.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  1482.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  1483.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  1484.    File1 = "c:\config.sys"
  1485.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  1486.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  1487.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  1488.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  1489.    txt_Result = strDisplay
  1490.    'time the function
  1491.    TimerStartOk = Timer
  1492.    For i = 1 To Iteration
  1493.       lngResult = cFileStatistics(File1, nL, nW, nC)
  1494.    Next i
  1495.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1496. End Sub
  1497. Private Sub TestGetDriveType()
  1498.    Dim intResult        As Integer
  1499.    Dim strResult        As String
  1500.    Dim strDisplay       As String
  1501.    Dim i                As Integer
  1502.    strResult = ""
  1503.    strDisplay = ""
  1504.    For i = 1 To 26
  1505.       intResult = cGetDriveType(Chr$(64 + i))
  1506.       If (intResult > 0) Then
  1507.          strDisplay = strDisplay & "'" & Chr$(64 + i) & ":' is "
  1508.          Select Case intResult
  1509.             Case DRIVE_UNKNOWN
  1510.                strDisplay = strDisplay & "(unknown)" & vbCrLf
  1511.             Case DRIVE_NO_ROOT_DIR
  1512.                strDisplay = strDisplay & "(not root dir)" & vbCrLf
  1513.             Case DRIVE_REMOVABLE
  1514.                strDisplay = strDisplay & "removable" & vbCrLf
  1515.             Case DRIVE_FIXED
  1516.                strDisplay = strDisplay & "fixed disk" & vbCrLf
  1517.             Case DRIVE_REMOTE
  1518.                strDisplay = strDisplay & "remote disk" & vbCrLf
  1519.             Case DRIVE_CDROM
  1520.                strDisplay = strDisplay & "cd-rom" & vbCrLf
  1521.             Case DRIVE_RAMDISK
  1522.                strDisplay = strDisplay & "ram disk" & vbCrLf
  1523.          End Select
  1524.       End If
  1525.    Next i
  1526.      
  1527.    txt_Result = strDisplay
  1528.    'time the function
  1529.    TimerStartOk = Timer
  1530.    For i = 1 To Iteration
  1531.       intResult = cGetDriveType("C")
  1532.    Next i
  1533.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1534. End Sub
  1535. Private Sub TestFileUUCP()
  1536.    Dim lngResult        As Long
  1537.    Dim strResult        As String
  1538.    Dim strDisplay       As String
  1539.    Dim i                As Integer
  1540.    Dim File1            As String
  1541.    Dim File2            As String
  1542.    Dim File3            As String
  1543.    strResult = ""
  1544.    strDisplay = ""
  1545.    File1 = "c:\win95\system.dat"
  1546.    File2 = "system.uuencoded"
  1547.    File3 = "system.uudecoded"
  1548.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  1549.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  1550.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  1551.    File1 = T2WFileTest
  1552.    File2 = "autoexec.uuencoded"
  1553.    File3 = "autoexec.uudecoded"
  1554.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  1555.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  1556.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  1557.    txt_Result = strDisplay
  1558.    'time the function
  1559.    TimerStartOk = Timer
  1560.    For i = 1 To Iteration
  1561.       lngResult = cFileUUCP(File1, File2, MODE_UUENCODE)
  1562.    Next i
  1563.    lngResult = cFileUUCP(File2, File3, MODE_UUDECODE)
  1564.    mdiMCDSK.pnl_Timer = Int((Timer - TimerStartOk) * 1000)
  1565. End Sub
  1566.