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