home *** CD-ROM | disk | FTP | other *** search
/ BUG 11 / BUGCD1998_02.ISO / util / time2win / t2w32500.exe / _FILE.FRM < prev    next >
Text File  |  1997-12-25  |  116KB  |  3,333 lines

  1. VERSION 5.00
  2. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#2.0#0"; "THREED20.OCX"
  3. Begin VB.Form frmFile 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "File"
  6.    ClientHeight    =   5805
  7.    ClientLeft      =   1485
  8.    ClientTop       =   2415
  9.    ClientWidth     =   7785
  10.    MaxButton       =   0   'False
  11.    MDIChild        =   -1  'True
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   5805
  14.    ScaleWidth      =   7785
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.TextBox txt_Result 
  17.       BackColor       =   &H00C0C0C0&
  18.       BorderStyle     =   0  'None
  19.       Height          =   4425
  20.       Left            =   105
  21.       Locked          =   -1  'True
  22.       MultiLine       =   -1  'True
  23.       ScrollBars      =   2  'Vertical
  24.       TabIndex        =   0
  25.       Top             =   630
  26.       Width           =   7575
  27.    End
  28.    Begin Threed.SSPanel SSPanel1 
  29.       Align           =   1  'Align Top
  30.       Height          =   480
  31.       Left            =   0
  32.       TabIndex        =   1
  33.       Top             =   0
  34.       Width           =   7785
  35.       _ExtentX        =   13732
  36.       _ExtentY        =   847
  37.       _Version        =   131073
  38.       ForeColor       =   -2147483640
  39.       BackColor       =   12632256
  40.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  41.          Name            =   "MS Sans Serif"
  42.          Size            =   8.25
  43.          Charset         =   0
  44.          Weight          =   400
  45.          Underline       =   0   'False
  46.          Italic          =   0   'False
  47.          Strikethrough   =   0   'False
  48.       EndProperty
  49.       Begin VB.ComboBox cmb_Function 
  50.          Height          =   315
  51.          Left            =   1365
  52.          TabIndex        =   2
  53.          Top             =   90
  54.          Width           =   5100
  55.       End
  56.       Begin Threed.SSCommand cmdNP 
  57.          Height          =   300
  58.          Index           =   1
  59.          Left            =   7455
  60.          TabIndex        =   6
  61.          Top             =   90
  62.          Width           =   255
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _Version        =   131073
  66.          Font3D          =   3
  67.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  68.             Name            =   "MS Sans Serif"
  69.             Size            =   8.25
  70.             Charset         =   0
  71.             Weight          =   400
  72.             Underline       =   0   'False
  73.             Italic          =   0   'False
  74.             Strikethrough   =   0   'False
  75.          EndProperty
  76.          Caption         =   ">"
  77.          ButtonStyle     =   2
  78.          BevelWidth      =   1
  79.          RoundedCorners  =   0   'False
  80.          Outline         =   0   'False
  81.       End
  82.       Begin Threed.SSCommand cmdNP 
  83.          Height          =   300
  84.          Index           =   0
  85.          Left            =   6615
  86.          TabIndex        =   5
  87.          Top             =   90
  88.          Width           =   255
  89.          _ExtentX        =   450
  90.          _ExtentY        =   529
  91.          _Version        =   131073
  92.          Font3D          =   3
  93.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  94.             Name            =   "MS Sans Serif"
  95.             Size            =   8.25
  96.             Charset         =   0
  97.             Weight          =   400
  98.             Underline       =   0   'False
  99.             Italic          =   0   'False
  100.             Strikethrough   =   0   'False
  101.          EndProperty
  102.          Caption         =   "<"
  103.          ButtonStyle     =   2
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.       Begin Threed.SSCommand SSCommand1 
  109.          Default         =   -1  'True
  110.          Height          =   300
  111.          Left            =   6930
  112.          TabIndex        =   3
  113.          Top             =   90
  114.          Width           =   465
  115.          _ExtentX        =   820
  116.          _ExtentY        =   529
  117.          _Version        =   131073
  118.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  119.             Name            =   "MS Sans Serif"
  120.             Size            =   8.25
  121.             Charset         =   0
  122.             Weight          =   400
  123.             Underline       =   0   'False
  124.             Italic          =   0   'False
  125.             Strikethrough   =   0   'False
  126.          EndProperty
  127.          Caption         =   "&Go"
  128.          ButtonStyle     =   2
  129.          BevelWidth      =   1
  130.          RoundedCorners  =   0   'False
  131.          Outline         =   0   'False
  132.       End
  133.       Begin VB.Label Label2 
  134.          Caption         =   "&Select a function"
  135.          Height          =   255
  136.          Left            =   90
  137.          TabIndex        =   4
  138.          Top             =   120
  139.          Width           =   1275
  140.       End
  141.    End
  142.    Begin VB.Label lblProgress 
  143.       Height          =   465
  144.       Left            =   90
  145.       TabIndex        =   7
  146.       Top             =   5220
  147.       Visible         =   0   'False
  148.       Width           =   7575
  149.    End
  150. End
  151. Attribute VB_Name = "frmFile"
  152. Attribute VB_GlobalNameSpace = False
  153. Attribute VB_Creatable = False
  154. Attribute VB_PredeclaredId = True
  155. Attribute VB_Exposed = False
  156. Option Explicit
  157. Option Base 1
  158.  
  159. Private Const Iteration = 10
  160.  
  161. Dim IsLoaded         As Integer
  162.  
  163. Dim TimerStartOk     As Integer
  164. Dim TimerCloseOk     As Integer
  165.  
  166. Dim TimerHandle      As Integer
  167. Dim TimerValue       As Long
  168.  
  169. Private Sub cmdNP_Click(Index As Integer)
  170.  
  171.    Call sub_NextPrev(cmb_Function, Index)
  172.  
  173. End Sub
  174.  
  175. Private Sub cmb_Function_Click()
  176.    
  177.    If (IsLoaded = False) Then Exit Sub
  178.    
  179.    Call cDisableFI(mdiT2W.Picture1)
  180.    
  181.    txt_Result = ""
  182.    lblProgress.Visible = False
  183.    
  184.    DoEvents
  185.    
  186.    Select Case cmb_Function.ListIndex
  187.       Case 0
  188.          Call TestAllSubDirectories
  189.       Case 1
  190.          Call TestChDir
  191.       Case 2
  192.          Call TestChDrive
  193.       Case 3
  194.          Call TestFileCompressExpandTab
  195.       Case 4
  196.          Call TestFileCopy
  197.       Case 5
  198.          Call TestFileMove
  199.       Case 6
  200.          Call TestFileFilter
  201.       Case 7
  202.          Call TestFileFilterNot
  203.       Case 8
  204.          Call TestFileSize
  205.       Case 9
  206.          Call TestFileLineCount
  207.       Case 10
  208.          Call TestFileUpperLower
  209.       Case 11
  210.          Call TestFileMerge
  211.       Case 12
  212.          Call TestFileSearchAndReplace
  213.       Case 13
  214.          Call TestFileSearch
  215.       Case 14
  216.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, False)
  217.       Case 15
  218.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, False)
  219.       Case 16
  220.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, False)
  221.       Case 17
  222.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, False)
  223.       Case 18
  224.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, True)
  225.       Case 19
  226.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, True)
  227.       Case 20
  228.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, True)
  229.       Case 21
  230.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, True)
  231.       Case 22
  232.          Call TestFileChangeChars
  233.       Case 23
  234.          Call TestIsFileX
  235.       Case 24
  236.          Call TestKillDir
  237.       Case 25
  238.          Call TestKillDirs
  239.       Case 26
  240.          Call TestGetDiskSpace
  241.       Case 27
  242.          Call TestGetDiskUsed
  243.       Case 28
  244.          Call TestGetDiskFree
  245.       Case 29
  246.          Call TestGetDiskClusterSize
  247.       Case 30
  248.          Call TestCountFiles
  249.       Case 31
  250.          Call TestCountDirectories
  251.       Case 32
  252.          Call TestRcsCountFileDir
  253.       Case 33
  254.          Call TestFilesSizeX
  255.       Case 34
  256.          Call TestRcsFilesSizeX
  257.       Case 35
  258.          Call TestTruncatePath
  259.       Case 36
  260.          Call TestMakeSplitPath
  261.       Case 37
  262.          Call TestFullPath
  263.       Case 38
  264.          Call TestRenameFile
  265.       Case 39
  266.          Call TestUniqueFileName
  267.       Case 40
  268.          Call TestFilesInDirectory
  269.       Case 41
  270.          Call TestSubDirectory
  271.       Case 42
  272.          Call TestFileGetAttribute
  273.       Case 43
  274.          Call TestFileSetAttribute
  275.       Case 44
  276.          Call TestFileSetAllAttributes
  277.       Case 45
  278.          Call TestFileResetAllAttributes
  279.       Case 46
  280.          Call TestFileCompareX
  281.       Case 47
  282.          Call TestFileDrive
  283.       Case 48
  284.          Call TestFilesInDirOnDisk
  285.       Case 49
  286.          Call TestFileDateTime
  287.       Case 50
  288.          Call TestFileStatistics
  289.       Case 51
  290.          Call TestGetDriveType
  291.       Case 52
  292.          Call TestPBFileCopy
  293.       Case 53
  294.          Call TestDBFileCopy
  295.       Case 54
  296.          Call TestFileUUCP
  297.       Case 55
  298.          Call TestOpenFiles(ENUMERATE_ALL_OPEN_FILES)
  299.       Case 56
  300.          Call TestOpenFiles(ENUMERATE_ONLY_OPEN_UNMOVABLE_FILES)
  301.       Case 57
  302.          Call TestSplitFile
  303.       Case 58
  304.          Call TestCutFile
  305.       Case 59
  306.          Call TestGetFileDateTime
  307.       Case 60
  308.          Call TestSetFileDateTime
  309.       Case 61
  310.          Call TestFileMergeExt
  311.       Case 62
  312.          Call TestGetFileTypeName
  313.       Case 63
  314.          Call TestGetFileDisplayName
  315.       Case 64
  316.          Call TestFilesCopy
  317.       Case 65
  318.          lblProgress.Visible = True
  319.          Call TestFilesCopyExt
  320.       Case 66
  321.          Call TestShortCutFile
  322.    End Select
  323.  
  324.    DoEvents
  325.    Call cEnableFI(mdiT2W.Picture1)
  326.    
  327. End Sub
  328.  
  329. Private Sub Form_Activate()
  330.  
  331.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  332.  
  333. End Sub
  334.  
  335. Private Sub Form_Load()
  336.  
  337.    IsLoaded = False
  338.    
  339.    Show
  340.  
  341.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_file.t2w")
  342.    
  343.    IsLoaded = True
  344.    
  345. End Sub
  346.  
  347. Private Sub SSCommand1_Click()
  348.    
  349.    Call cmb_Function_Click
  350.    
  351. End Sub
  352.  
  353. Private Sub TestAllSubDirectories()
  354.  
  355.    Dim intResult        As Integer
  356.    Dim strResult        As String
  357.    Dim strDisplay       As String
  358.    
  359.    Dim i                As Long
  360.    
  361.    strResult = ""
  362.    strDisplay = ""
  363.    
  364.    i = -1
  365.  
  366.    TimerHandle = cTimerOpen()
  367.    TimerStartOk = cTimerStart(TimerHandle)
  368.    
  369.    strResult = cAllSubDirectories("C:", i)
  370.    
  371.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  372.    TimerCloseOk = cTimerClose(TimerHandle)
  373.    
  374.    strResult = cStringSAR(strResult, vbCr, vbCrLf, False)
  375.    
  376.    strDisplay = "Directories founden on drive C are " & i & vbCrLf & vbCrLf & strResult
  377.    
  378.    txt_Result = strDisplay
  379.  
  380. End Sub
  381.  
  382. Private Sub TestChDir()
  383.  
  384.    Dim intResult        As Integer
  385.    Dim strResult        As String
  386.    Dim strDisplay       As String
  387.    
  388.    Dim i                As Integer
  389.    
  390.    strResult = ""
  391.    strDisplay = ""
  392.    
  393.    For i = 1 To 26
  394.       intResult = cChDir(Chr$(64 + i) & ":\")
  395.       If (intResult = True) Then
  396.          strDisplay = strDisplay & "ChDir to \ on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  397.       End If
  398.    Next i
  399.      
  400.    txt_Result = strDisplay
  401.  
  402.    'time the function
  403.  
  404.    TimerHandle = cTimerOpen()
  405.    TimerStartOk = cTimerStart(TimerHandle)
  406.    
  407.    For i = 1 To Iteration
  408.       intResult = cChDir("C:\")
  409.    Next i
  410.    
  411.    intResult = cChDir(T2WDirTest)
  412.    
  413.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  414.    
  415.    TimerCloseOk = cTimerClose(TimerHandle)
  416.  
  417. End Sub
  418.  
  419. Private Sub TestChDrive()
  420.  
  421.    Dim intResult        As Integer
  422.    Dim strResult        As String
  423.    Dim strDisplay       As String
  424.    
  425.    Dim i                As Integer
  426.    
  427.    strResult = ""
  428.    strDisplay = ""
  429.    
  430.    For i = 1 To 26
  431.       intResult = cChDrive(Chr$(64 + i))
  432.       If (intResult = True) Then
  433.          strDisplay = strDisplay & "ChDrive on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  434.       End If
  435.    Next i
  436.    
  437.    txt_Result = strDisplay
  438.  
  439.    'time the function
  440.  
  441.    TimerHandle = cTimerOpen()
  442.    TimerStartOk = cTimerStart(TimerHandle)
  443.    
  444.    For i = 1 To Iteration
  445.       intResult = cChDrive("C")
  446.    Next i
  447.    
  448.    intResult = cChDrive(T2WDirTest)
  449.    
  450.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  451.    
  452.    TimerCloseOk = cTimerClose(TimerHandle)
  453.  
  454. End Sub
  455.  
  456. Private Sub TestFileCompressExpandTab()
  457.  
  458.    Dim lResult          As Long
  459.    Dim strResult        As String
  460.    Dim strDisplay       As String
  461.    
  462.    Dim i                As Long
  463.    
  464.    Dim File1            As String
  465.    Dim File2            As String
  466.    Dim File3            As String
  467.    
  468.    strResult = ""
  469.    strDisplay = ""
  470.    
  471.    File1 = T2WFileTest
  472.    File2 = "autoexec.tabcompressed"
  473.    File3 = "autoexec.tabexpanded"
  474.    
  475.    For i = 1 To 4
  476.       strDisplay = strDisplay & "File CompressTab (" & i & " spaces = 1 tab) " & File1 & " to " & File2 & " is " & cFileCompressTab(File1, File2, i) & vbCrLf
  477.       strDisplay = strDisplay & "File ExpandTab (" & i & " spaces = 1 tab) " & File2 & " to " & File3 & " is " & cFileExpandTab(File2, File3, i) & vbCrLf
  478.       strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  479.    Next i
  480.  
  481.    txt_Result = strDisplay
  482.  
  483.    'time the function
  484.  
  485.    TimerHandle = cTimerOpen()
  486.    TimerStartOk = cTimerStart(TimerHandle)
  487.    
  488.    For i = 1 To Iteration
  489.       lResult = cFileExpandTab(File1, File2, 3)
  490.    Next i
  491.    
  492.    lResult = cFileCompressTab(File2, File3, 3)
  493.    
  494.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  495.    
  496.    TimerCloseOk = cTimerClose(TimerHandle)
  497.  
  498. End Sub
  499.  
  500. Private Sub TestFileCopy()
  501.  
  502.    Dim lResult          As Long
  503.    Dim strResult        As String
  504.    Dim strDisplay       As String
  505.    
  506.    Dim i                As Long
  507.    
  508.    Dim File1            As String
  509.    Dim File2            As String
  510.   
  511.    strResult = ""
  512.    strDisplay = ""
  513.    
  514.    File1 = T2WFileTest
  515.    File2 = "autoexec.copy"
  516.    
  517.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  518.    
  519.    strDisplay = strDisplay & "File Copy2 '" & File1 & "' to '" & File2 & "' is " & cFileCopy2(File1, File2) & vbCrLf & vbCrLf
  520.  
  521.    strDisplay = strDisplay & "File Force Copy '" & File1 & "' to '" & File2 & "' is " & cFileForceCopy(File1, File2, True) & vbCrLf & vbCrLf
  522.    
  523.    txt_Result = strDisplay
  524.  
  525.    'time the function
  526.  
  527.    TimerHandle = cTimerOpen()
  528.    TimerStartOk = cTimerStart(TimerHandle)
  529.    
  530.    For i = 1 To Iteration
  531.       lResult = cFileCopy(File1, File2)
  532.    Next i
  533.    
  534.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  535.    
  536.    TimerCloseOk = cTimerClose(TimerHandle)
  537.  
  538. End Sub
  539.  
  540. Private Sub TestFileMove()
  541.  
  542.    Dim lResult          As Long
  543.    Dim strResult        As String
  544.    Dim strDisplay       As String
  545.    
  546.    Dim i                As Long
  547.    
  548.    Dim File1            As String
  549.    Dim File2            As String
  550.   
  551.    strResult = ""
  552.    strDisplay = ""
  553.    
  554.    File1 = T2WFileTest
  555.    File2 = cGetWindowsDirectory() & "\autoexec.bat"
  556.    
  557.    strDisplay = strDisplay & "File Move '" & File1 & "' to '" & File2 & "' is " & cFileMove(File1, File2) & vbCrLf & vbCrLf
  558.    
  559.    txt_Result = strDisplay
  560.  
  561.    'time the function
  562.  
  563.    TimerHandle = cTimerOpen()
  564.    TimerStartOk = cTimerStart(TimerHandle)
  565.    
  566.    For i = 1 To Iteration
  567.       lResult = cFileMove(File1, File2)
  568.    Next i
  569.    
  570.    lResult = cFileCopy(File2, File1)
  571.    
  572.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  573.    
  574.    TimerCloseOk = cTimerClose(TimerHandle)
  575.  
  576. End Sub
  577.  
  578. Private Sub TestFileFilter()
  579.  
  580.    Dim lResult          As Long
  581.    Dim strResult        As String
  582.    Dim strDisplay       As String
  583.    
  584.    Dim i                As Long
  585.    
  586.    Dim File1            As String
  587.    Dim File2            As String
  588.    
  589.    Dim Filter           As String
  590.   
  591.    strResult = ""
  592.    strDisplay = ""
  593.    
  594.    File1 = T2WFileTest
  595.    File2 = "autoexec.filter"
  596.    
  597.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  598.    Filter = Filter + LCase$(Filter)
  599.  
  600.    strDisplay = strDisplay & "File Filter (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  601.  
  602.    txt_Result = strDisplay
  603.  
  604.    'time the function
  605.  
  606.    TimerHandle = cTimerOpen()
  607.    TimerStartOk = cTimerStart(TimerHandle)
  608.    
  609.    For i = 1 To Iteration
  610.       lResult = cFileFilter(File1, File2, Filter)
  611.    Next i
  612.    
  613.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  614.    
  615.    TimerCloseOk = cTimerClose(TimerHandle)
  616.  
  617. End Sub
  618.  
  619. Private Sub TestFileFilterNot()
  620.  
  621.    Dim lResult          As Long
  622.    Dim strResult        As String
  623.    Dim strDisplay       As String
  624.    
  625.    Dim i                As Long
  626.    
  627.    Dim File1            As String
  628.    Dim File2            As String
  629.    
  630.    Dim Filter           As String
  631.   
  632.    strResult = ""
  633.    strDisplay = ""
  634.    
  635.    File1 = T2WFileTest
  636.    File2 = "autoexec.filternot"
  637.    
  638.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  639.    Filter = Filter + LCase$(Filter)
  640.  
  641.    strDisplay = strDisplay & "File Filter Not (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  642.  
  643.    txt_Result = strDisplay
  644.  
  645.    'time the function
  646.  
  647.    TimerHandle = cTimerOpen()
  648.    TimerStartOk = cTimerStart(TimerHandle)
  649.    
  650.    For i = 1 To Iteration
  651.       lResult = cFileFilterNot(File1, File2, Filter)
  652.    Next i
  653.    
  654.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  655.    
  656.    TimerCloseOk = cTimerClose(TimerHandle)
  657.  
  658. End Sub
  659.  
  660. Private Sub TestFileSize()
  661.  
  662.    Dim lResult          As Long
  663.    Dim strResult        As String
  664.    Dim strDisplay       As String
  665.    
  666.    Dim i                As Long
  667.    
  668.    Dim File1            As String
  669.    Dim File2            As String
  670.   
  671.    strResult = ""
  672.    strDisplay = ""
  673.    
  674.    File1 = T2WFileTest
  675.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  676.    
  677.    File1 = "c:\autoexec.bat"
  678.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  679.    
  680.    File1 = "c:\config.sys"
  681.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  682.    
  683.    File1 = "c:\test.tst"
  684.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  685.    
  686.    File1 = "c:\command.com"
  687.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  688.    
  689.    txt_Result = strDisplay
  690.  
  691.    'time the function
  692.  
  693.    TimerHandle = cTimerOpen()
  694.    TimerStartOk = cTimerStart(TimerHandle)
  695.    
  696.    For i = 1 To Iteration
  697.       lResult = cFileSize(File1)
  698.    Next i
  699.    
  700.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  701.    
  702.    TimerCloseOk = cTimerClose(TimerHandle)
  703.  
  704. End Sub
  705.  
  706. Private Sub TestFileLineCount()
  707.  
  708.    Dim lResult          As Long
  709.    Dim strResult        As String
  710.    Dim strDisplay       As String
  711.    
  712.    Dim i                As Long
  713.    
  714.    Dim File1            As String
  715.    Dim File2            As String
  716.   
  717.    strResult = ""
  718.    strDisplay = ""
  719.    
  720.    File1 = T2WFileTest
  721.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  722.  
  723.    File1 = "c:\autoexec.bat"
  724.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  725.    
  726.    File1 = "c:\config.sys"
  727.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  728.    
  729.    File1 = "c:\test.tst"
  730.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  731.    
  732.    File1 = "c:\command.com"
  733.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  734.    
  735.    txt_Result = strDisplay
  736.  
  737.    'time the function
  738.  
  739.    TimerHandle = cTimerOpen()
  740.    TimerStartOk = cTimerStart(TimerHandle)
  741.    
  742.    For i = 1 To Iteration
  743.       lResult = cFileLineCount(File1)
  744.    Next i
  745.    
  746.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  747.    
  748.    TimerCloseOk = cTimerClose(TimerHandle)
  749.  
  750. End Sub
  751.  
  752. Public Sub TestFileUpperLower()
  753.  
  754.    Dim lResult          As Long
  755.    Dim strResult        As String
  756.    Dim strDisplay       As String
  757.    
  758.    Dim i                As Long
  759.    
  760.    Dim File1            As String
  761.    Dim File2            As String
  762.    Dim File3            As String
  763.    
  764.    strResult = ""
  765.    strDisplay = ""
  766.    
  767.    File1 = T2WFileTest
  768.    File2 = "autoexec.toupper"
  769.    File3 = "autoexec.tolower"
  770.    
  771.    strDisplay = strDisplay & "File to upper '" & File1 & "' to '" & File2 & "' is " & cFileToUpper(File1, File2) & vbCrLf & vbCrLf
  772.    strDisplay = strDisplay & "File to lower '" & File1 & "' to '" & File3 & "' is " & cFileToLower(File1, File3) & vbCrLf & vbCrLf
  773.  
  774.    txt_Result = strDisplay
  775.  
  776.    'time the function
  777.  
  778.    TimerHandle = cTimerOpen()
  779.    TimerStartOk = cTimerStart(TimerHandle)
  780.    
  781.    For i = 1 To Iteration
  782.       lResult = cFileToUpper(File1, File2)
  783.    Next i
  784.    
  785.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  786.    
  787.    TimerCloseOk = cTimerClose(TimerHandle)
  788.  
  789. End Sub
  790.  
  791. Private Sub TestFileMerge()
  792.  
  793.    Dim lResult          As Long
  794.    Dim strResult        As String
  795.    Dim strDisplay       As String
  796.    
  797.    Dim i                As Long
  798.    
  799.    Dim File1            As String
  800.    Dim File2            As String
  801.    Dim File3            As String
  802.   
  803.    strResult = ""
  804.    strDisplay = ""
  805.    
  806.    File1 = T2WFileTest
  807.    File2 = "c:\config.sys"
  808.    File3 = "autoexec.merged"
  809.    
  810.    strDisplay = strDisplay & "File Merge '" & File1 & "' and '" & File2 & "' to '" & File3 & "' is " & cFileMerge(File1, File2, File3) & vbCrLf & vbCrLf
  811.  
  812.    txt_Result = strDisplay
  813.  
  814.    'time the function
  815.  
  816.    TimerHandle = cTimerOpen()
  817.    TimerStartOk = cTimerStart(TimerHandle)
  818.    
  819.    For i = 1 To Iteration
  820.       lResult = cFileMerge(File1, File2, File3)
  821.    Next i
  822.    
  823.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  824.    
  825.    TimerCloseOk = cTimerClose(TimerHandle)
  826.  
  827. End Sub
  828.  
  829. Private Sub TestFileSearchAndReplace()
  830.  
  831.    Dim lResult          As Long
  832.    Dim strResult        As String
  833.    Dim strDisplay       As String
  834.    
  835.    Dim i                As Long
  836.    
  837.    Dim File1            As String
  838.    Dim File2            As String
  839.    
  840.    Dim Search           As String
  841.    Dim Replace          As String
  842.    
  843.    strResult = ""
  844.    strDisplay = ""
  845.    
  846.    File1 = T2WFileTest
  847.    File2 = "autoexec.searchandreplace"
  848.    
  849.    Search = "rem" ' SET "
  850.    Replace = "REM" ' set "
  851.    
  852.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  853.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Search & "' -> '" & Replace & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Search, Replace, "tmp.tmp", True) & vbCrLf & vbCrLf
  854.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Replace & "' -> '" & Search & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Replace, Search, "tmp.tmp", True) & vbCrLf & vbCrLf
  855.    strDisplay = strDisplay & "Compare file contents (insensitive) '" & File2 & "' with '" & File1 & "' is " & IIf(cCmpFileContents(File2, File1, False) = True, "same", "not same") & vbCrLf & vbCrLf
  856.  
  857.    txt_Result = strDisplay
  858.  
  859.    'time the function
  860.  
  861.    TimerHandle = cTimerOpen()
  862.    TimerStartOk = cTimerStart(TimerHandle)
  863.    
  864.    For i = 1 To Iteration
  865.       If ((i Mod 2) = 1) Then
  866.          lResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  867.       Else
  868.          lResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  869.       End If
  870.    Next i
  871.    
  872.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  873.    
  874.    TimerCloseOk = cTimerClose(TimerHandle)
  875.  
  876. End Sub
  877.  
  878. Private Sub TestFileSearch()
  879.  
  880.    Dim lResult          As Long
  881.    Dim strResult        As String
  882.    Dim strDisplay       As String
  883.    
  884.    Dim i                As Long
  885.    
  886.    Dim File1            As String
  887.    
  888.    Dim Search1          As String
  889.    Dim Search2          As String
  890.    
  891.    strResult = ""
  892.    strDisplay = ""
  893.    
  894.    File1 = T2WFileTest
  895.    
  896.    Search1 = "re"
  897.    Search2 = "SET"
  898.  
  899.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, False) & vbCrLf & vbCrLf
  900.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, False) & vbCrLf & vbCrLf
  901.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, False) & vbCrLf & vbCrLf
  902.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, False) & vbCrLf & vbCrLf
  903.  
  904.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, True) & vbCrLf & vbCrLf
  905.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, True) & vbCrLf & vbCrLf
  906.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, True) & vbCrLf & vbCrLf
  907.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, True) & vbCrLf & vbCrLf
  908.  
  909.    txt_Result = strDisplay
  910.  
  911.    'time the function
  912.  
  913.    TimerHandle = cTimerOpen()
  914.    TimerStartOk = cTimerStart(TimerHandle)
  915.    
  916.    For i = 1 To Iteration
  917.       If ((i Mod 2) = 1) Then
  918.          lResult = cFileSearch(File1, Search1, False)
  919.       Else
  920.          lResult = cFileSearchCount(File1, Search2, False)
  921.       End If
  922.    Next i
  923.    
  924.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  925.    
  926.    TimerCloseOk = cTimerClose(TimerHandle)
  927.  
  928. End Sub
  929.  
  930. Private Sub TestFileSort(intSortMethod As Integer, intVarFix As Integer)
  931.    
  932.    Dim lResult          As Long
  933.    Dim strResult        As String
  934.    Dim strDisplay       As String
  935.    
  936.    Dim i                As Long
  937.    Dim n                As Long
  938.    
  939.    Dim File1            As String
  940.    Dim File2            As String
  941.   
  942.    strResult = ""
  943.    strDisplay = ""
  944.  
  945.    File1 = T2WFileTest
  946.    File2 = "autoexec.sort" & intSortMethod & Abs(intVarFix)
  947.    
  948.    strDisplay = "The 7 first lines in '" & File1 & "' before sorting are " & vbCrLf & vbCrLf
  949.    
  950.    Close #1
  951.    Open File1 For Input Shared As #1
  952.    For i = 1 To 7
  953.       Line Input #1, strResult
  954.       strDisplay = strDisplay + strResult + vbCrLf
  955.    Next i
  956.    Close #1
  957.  
  958.    If (intVarFix = False) Then
  959.       lResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  960.    Else
  961.       lResult = cFileSort(File1, File2, intSortMethod, 7, 0, 7, n)
  962.    End If
  963.    
  964.    strDisplay = strDisplay + vbCrLf
  965.    strDisplay = strDisplay + "The 7 first lines in '" & File2 & "' after sorting are " & vbCrLf & vbCrLf
  966.    
  967.    Close #1
  968.    Open File2 For Input Shared As #1
  969.    For i = 1 To 7
  970.       Line Input #1, strResult
  971.       strDisplay = strDisplay + strResult + vbCrLf
  972.    Next i
  973.    Close #1
  974.  
  975.    strDisplay = strDisplay + vbCrLf
  976.    
  977.    Select Case intSortMethod
  978.       Case (SORT_ASCENDING + SORT_CASE_SENSITIVE):
  979.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and CS is '" & lResult & "' and records are '" & n & "'"
  980.       Case (SORT_DESCENDING + SORT_CASE_SENSITIVE):
  981.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and CS is '" & lResult & "' and records are '" & n & "'"
  982.       Case (SORT_ASCENDING + SORT_CASE_INSENSITIVE):
  983.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and NS is '" & lResult & "' and records are '" & n & "'"
  984.       Case (SORT_DESCENDING + SORT_CASE_INSENSITIVE):
  985.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and NS is '" & lResult & "' and records are '" & n & "'"
  986.    End Select
  987.  
  988.    txt_Result = strDisplay
  989.  
  990.    'time the function
  991.  
  992.    TimerHandle = cTimerOpen()
  993.    TimerStartOk = cTimerStart(TimerHandle)
  994.    
  995.    For i = 1 To Iteration
  996.       lResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  997.    Next i
  998.    
  999.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1000.    
  1001.    TimerCloseOk = cTimerClose(TimerHandle)
  1002.    
  1003. End Sub
  1004.  
  1005. Private Sub TestFileChangeChars()
  1006.  
  1007.    Dim lResult          As Long
  1008.    Dim strResult        As String
  1009.    Dim strDisplay       As String
  1010.    
  1011.    Dim i                As Long
  1012.    
  1013.    Dim File1            As String
  1014.    Dim File2            As String
  1015.    
  1016.    Dim Change1          As String
  1017.    Dim Change2          As String
  1018.    
  1019.    strResult = ""
  1020.    strDisplay = ""
  1021.    
  1022.    File1 = T2WFileTest
  1023.    File2 = "autoexec.changechars"
  1024.    
  1025.    Change1 = "REM"
  1026.    Change2 = "mer"
  1027.    
  1028.    txt_Result = strDisplay
  1029.  
  1030.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  1031.    
  1032.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' before change are " & vbCrLf & vbCrLf
  1033.    
  1034.    Close #1
  1035.    Open File2 For Input Shared As #1
  1036.    For i = 1 To 7
  1037.       Line Input #1, strResult
  1038.       strDisplay = strDisplay + strResult + vbCrLf
  1039.    Next i
  1040.    Close #1
  1041.  
  1042.    strDisplay = strDisplay + vbCrLf
  1043.    
  1044.    strDisplay = strDisplay & "File Change Chars : '" & Change1 & "' -> '" & Change2 & "' in '" & File2 & "' is " & cFileChangeChars(File2, Change1, Change2, "file1.file1") & vbCrLf & vbCrLf
  1045.  
  1046.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' after change are " & vbCrLf & vbCrLf
  1047.    
  1048.    Close #1
  1049.    Open File2 For Input Shared As #1
  1050.    For i = 1 To 7
  1051.       Line Input #1, strResult
  1052.       strDisplay = strDisplay + strResult + vbCrLf
  1053.    Next i
  1054.    Close #1
  1055.    
  1056.    txt_Result = strDisplay
  1057.  
  1058.    'time the function
  1059.  
  1060.    TimerHandle = cTimerOpen()
  1061.    TimerStartOk = cTimerStart(TimerHandle)
  1062.    
  1063.    For i = 1 To Iteration
  1064.       If ((i Mod 2) = 1) Then
  1065.          lResult = cFileChangeChars(File2, Change1, Change2, "")
  1066.       Else
  1067.          lResult = cFileChangeChars(File2, Change2, Change1, "")
  1068.       End If
  1069.    Next i
  1070.    
  1071.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1072.    
  1073.    TimerCloseOk = cTimerClose(TimerHandle)
  1074.  
  1075. End Sub
  1076.  
  1077. Private Sub TestIsFileX()
  1078.  
  1079.    Dim intResult        As Integer
  1080.    Dim strResult        As String
  1081.    Dim strDisplay       As String
  1082.    
  1083.    Dim i                As Integer
  1084.    
  1085.    Dim File1            As String
  1086.    
  1087.    strResult = ""
  1088.    strDisplay = ""
  1089.    
  1090.    File1 = T2WFileTest
  1091.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  1092.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  1093.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  1094.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  1095.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  1096.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  1097.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  1098.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  1099.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  1100.      
  1101.    File1 = cGetWindowsDirectory() & "\user.dat"
  1102.    
  1103.    strDisplay = strDisplay & vbCrLf
  1104.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  1105.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  1106.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  1107.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  1108.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  1109.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  1110.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  1111.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  1112.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  1113.      
  1114.    txt_Result = strDisplay
  1115.  
  1116.    'time the function
  1117.  
  1118.    TimerHandle = cTimerOpen()
  1119.    TimerStartOk = cTimerStart(TimerHandle)
  1120.    
  1121.    For i = 1 To Iteration
  1122.       intResult = cIsFilenameValid(File1)
  1123.    Next i
  1124.    
  1125.    intResult = cChDir(T2WDirTest)
  1126.    
  1127.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1128.    
  1129.    TimerCloseOk = cTimerClose(TimerHandle)
  1130.  
  1131. End Sub
  1132.  
  1133. Private Sub TestKillDir()
  1134.  
  1135.    Dim intResult        As Integer
  1136.    Dim strResult        As String
  1137.    Dim strDisplay       As String
  1138.    
  1139.    Dim i                As Integer
  1140.    
  1141.    Dim File1            As String
  1142.    
  1143.    strResult = ""
  1144.    strDisplay = ""
  1145.    
  1146.    File1 = "c:\this is a test for KillDir"
  1147.    
  1148.    intResult = cMakeDir(File1)
  1149.    
  1150.    strDisplay = strDisplay & "Directory '" & File1 & "' is created" & vbCrLf & vbCrLf
  1151.    
  1152.    strDisplay = strDisplay & "Directory '" & File1 & "' is " & IIf(cKillDir(File1) = True, "deleted", "not deleted") & vbCrLf & vbCrLf
  1153.      
  1154.    txt_Result = strDisplay
  1155.  
  1156.    'time the function
  1157.  
  1158.    TimerHandle = cTimerOpen()
  1159.    TimerStartOk = cTimerStart(TimerHandle)
  1160.    
  1161.    For i = 1 To Iteration
  1162.       intResult = cKillDir(File1)
  1163.    Next i
  1164.    
  1165.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1166.    
  1167.    TimerCloseOk = cTimerClose(TimerHandle)
  1168.  
  1169. End Sub
  1170.  
  1171. Private Sub TestKillDirs()
  1172.  
  1173.    Dim intResult        As Integer
  1174.    Dim strResult        As String
  1175.    Dim strDisplay       As String
  1176.    
  1177.    Dim i                As Integer
  1178.    
  1179.    Dim File1            As String
  1180.    
  1181.    strResult = ""
  1182.    strDisplay = ""
  1183.    
  1184.    File1 = "c:\this1\this2\this3\this4"
  1185.    
  1186.    intResult = cMakeMultipleDir(File1)
  1187.   
  1188.    strDisplay = strDisplay & "Directories '" & File1 & "' are created" & vbCrLf & vbCrLf
  1189.    
  1190.    intResult = cKillDirs("c:\this1", False)
  1191.    
  1192.    strDisplay = strDisplay & "Directories '" & File1 & "' (except c:\this) are " & IIf(intResult, "deleted (total : " & intResult & ")", "not deleted") & vbCrLf & vbCrLf
  1193.      
  1194.    strDisplay = strDisplay & "Directories '" & File1 & "' are recreated" & vbCrLf & vbCrLf
  1195.    
  1196.    intResult = cMakeMultipleDir(File1)
  1197.    
  1198.    intResult = cKillDirs("c:\this1", True)
  1199.    
  1200.    strDisplay = strDisplay & "Directories '" & File1 & "' (include c:\this) are " & IIf(intResult, "deleted (total : " & intResult & ")", "not deleted") & vbCrLf & vbCrLf
  1201.      
  1202.    txt_Result = strDisplay
  1203.  
  1204.    'time the function
  1205.  
  1206.    TimerHandle = cTimerOpen()
  1207.    TimerStartOk = cTimerStart(TimerHandle)
  1208.    
  1209.    For i = 1 To Iteration
  1210.       intResult = cKillDirs(File1, True)
  1211.    Next i
  1212.    
  1213.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1214.    
  1215.    TimerCloseOk = cTimerClose(TimerHandle)
  1216.  
  1217. End Sub
  1218.  
  1219. Private Sub TestGetDiskSpace()
  1220.  
  1221.    Dim lResult        As Double
  1222.    Dim strResult        As String
  1223.    Dim strDisplay       As String
  1224.    
  1225.    Dim i                As Integer
  1226.    
  1227.    strResult = ""
  1228.    strDisplay = ""
  1229.    
  1230.    For i = 1 To 26
  1231.       lResult = cGetDiskSpace(Chr$(64 + i))
  1232.       If (lResult <> True) Then
  1233.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lResult & vbCrLf
  1234.       End If
  1235.    Next i
  1236.      
  1237.    txt_Result = strDisplay
  1238.  
  1239.    'time the function
  1240.  
  1241.    TimerHandle = cTimerOpen()
  1242.    TimerStartOk = cTimerStart(TimerHandle)
  1243.    
  1244.    For i = 1 To Iteration
  1245.       lResult = cGetDiskSpace("C")
  1246.    Next i
  1247.    
  1248.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1249.    
  1250.    TimerCloseOk = cTimerClose(TimerHandle)
  1251.  
  1252. End Sub
  1253.  
  1254. Private Sub TestGetDiskUsed()
  1255.  
  1256.    Dim lResult        As Double
  1257.    Dim strResult        As String
  1258.    Dim strDisplay       As String
  1259.    
  1260.    Dim i                As Integer
  1261.    
  1262.    strResult = ""
  1263.    strDisplay = ""
  1264.    
  1265.    For i = 1 To 26
  1266.       lResult = cGetDiskUsed(Chr$(64 + i))
  1267.       If (lResult <> True) Then
  1268.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lResult & vbCrLf
  1269.       End If
  1270.    Next i
  1271.      
  1272.    txt_Result = strDisplay
  1273.  
  1274.    'time the function
  1275.  
  1276.    TimerHandle = cTimerOpen()
  1277.    TimerStartOk = cTimerStart(TimerHandle)
  1278.    
  1279.    For i = 1 To Iteration
  1280.       lResult = cGetDiskUsed("C")
  1281.    Next i
  1282.    
  1283.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1284.    
  1285.    TimerCloseOk = cTimerClose(TimerHandle)
  1286.  
  1287. End Sub
  1288.  
  1289. Private Sub TestGetDiskFree()
  1290.  
  1291.    Dim lResult        As Double
  1292.    Dim strResult        As String
  1293.    Dim strDisplay       As String
  1294.    
  1295.    Dim i                As Integer
  1296.    
  1297.    strResult = ""
  1298.    strDisplay = ""
  1299.    
  1300.    For i = 1 To 26
  1301.       lResult = cGetDiskFree(Chr$(64 + i))
  1302.       If (lResult <> True) Then
  1303.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lResult & vbCrLf
  1304.       End If
  1305.    Next i
  1306.      
  1307.    txt_Result = strDisplay
  1308.  
  1309.    'time the function
  1310.  
  1311.    TimerHandle = cTimerOpen()
  1312.    TimerStartOk = cTimerStart(TimerHandle)
  1313.    
  1314.    For i = 1 To Iteration
  1315.       lResult = cGetDiskFree("C")
  1316.    Next i
  1317.    
  1318.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1319.    
  1320.    TimerCloseOk = cTimerClose(TimerHandle)
  1321.  
  1322. End Sub
  1323.  
  1324. Private Sub TestGetDiskClusterSize()
  1325.  
  1326.    Dim lResult        As Double
  1327.    Dim strResult        As String
  1328.    Dim strDisplay       As String
  1329.    
  1330.    Dim i                As Integer
  1331.    
  1332.    strResult = ""
  1333.    strDisplay = ""
  1334.    
  1335.    For i = 1 To 26
  1336.       lResult = cGetDiskClusterSize(Chr$(64 + i))
  1337.       If (lResult <> True) Then
  1338.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lResult & vbCrLf
  1339.       End If
  1340.    Next i
  1341.      
  1342.    txt_Result = strDisplay
  1343.  
  1344.    'time the function
  1345.  
  1346.    TimerHandle = cTimerOpen()
  1347.    TimerStartOk = cTimerStart(TimerHandle)
  1348.    
  1349.    For i = 1 To Iteration
  1350.       lResult = cGetDiskClusterSize("C")
  1351.    Next i
  1352.    
  1353.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1354.    
  1355.    TimerCloseOk = cTimerClose(TimerHandle)
  1356.  
  1357. End Sub
  1358.  
  1359. Private Sub TestRcsCountFileDir()
  1360.  
  1361.    Dim lResult          As Long
  1362.    Dim strResult        As String
  1363.    Dim strDisplay       As String
  1364.    
  1365.    Dim i                As Integer
  1366.    
  1367.    strResult = ""
  1368.    strDisplay = ""
  1369.    
  1370.    strDisplay = strDisplay & "Total directories in C: is " & cRcsCountFileDir(False, "C:", "", True) & vbCrLf
  1371.    strDisplay = strDisplay & "Total directories in D: is " & cRcsCountFileDir(False, "D:", "", True) & vbCrLf
  1372.    
  1373.    strDisplay = strDisplay & vbCrLf
  1374.  
  1375.    strDisplay = strDisplay & "Total files in C: is " & cRcsCountFileDir(True, "C:", "", True) & vbCrLf
  1376.    strDisplay = strDisplay & "Total files in D: is " & cRcsCountFileDir(True, "D:", "", True) & vbCrLf
  1377.    
  1378.    strDisplay = strDisplay & vbCrLf
  1379.  
  1380.    strDisplay = strDisplay & "Total files in C:*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", True) & vbCrLf
  1381.    strDisplay = strDisplay & "Total files in D:*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", True) & vbCrLf
  1382.    
  1383.    strDisplay = strDisplay & vbCrLf
  1384.  
  1385.    strDisplay = strDisplay & "Total directories in C:\ is " & cRcsCountFileDir(False, "C:", "", False) & vbCrLf
  1386.    strDisplay = strDisplay & "Total directories in D:\ is " & cRcsCountFileDir(False, "D:", "", False) & vbCrLf
  1387.    
  1388.    strDisplay = strDisplay & vbCrLf
  1389.  
  1390.    strDisplay = strDisplay & "Total files in C:\ is " & cRcsCountFileDir(True, "C:", "", False) & vbCrLf
  1391.    strDisplay = strDisplay & "Total files in D:\ is " & cRcsCountFileDir(True, "D:", "", False) & vbCrLf
  1392.    
  1393.    strDisplay = strDisplay & vbCrLf
  1394.  
  1395.    strDisplay = strDisplay & "Total files in C:\*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", False) & vbCrLf
  1396.    strDisplay = strDisplay & "Total files in D:\*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", False) & vbCrLf
  1397.    
  1398.    txt_Result = strDisplay
  1399.  
  1400.    'time the function
  1401.  
  1402.    TimerHandle = cTimerOpen()
  1403.    TimerStartOk = cTimerStart(TimerHandle)
  1404.    
  1405.    For i = 1 To Iteration
  1406.       lResult = cRcsCountFileDir(False, "C:", "", False)
  1407.    Next i
  1408.    
  1409.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1410.    
  1411.    TimerCloseOk = cTimerClose(TimerHandle)
  1412.  
  1413. End Sub
  1414.  
  1415. Private Sub TestCountFiles()
  1416.  
  1417.    Dim lResult          As Long
  1418.    Dim strResult        As String
  1419.    Dim strDisplay       As String
  1420.    
  1421.    Dim i                As Integer
  1422.    
  1423.    strResult = ""
  1424.    strDisplay = ""
  1425.    
  1426.    strDisplay = strDisplay & "Number of files in C:\ is " & cCountFiles("C:\*.*") & vbCrLf & vbCrLf
  1427.    strDisplay = strDisplay & "Number of files in D:\ is " & cCountFiles("D:\*.*") & vbCrLf & vbCrLf
  1428.    strDisplay = strDisplay & "Number of files in E:\ is " & cCountFiles("E:\*.*") & vbCrLf & vbCrLf
  1429.    
  1430.    txt_Result = strDisplay
  1431.  
  1432.    'time the function
  1433.  
  1434.    TimerHandle = cTimerOpen()
  1435.    TimerStartOk = cTimerStart(TimerHandle)
  1436.    
  1437.    For i = 1 To Iteration
  1438.       lResult = cCountFiles("C:\*.*")
  1439.    Next i
  1440.    
  1441.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1442.    
  1443.    TimerCloseOk = cTimerClose(TimerHandle)
  1444.  
  1445. End Sub
  1446.  
  1447. Private Sub TestCountDirectories()
  1448.  
  1449.    Dim lResult          As Long
  1450.    Dim strResult        As String
  1451.    Dim strDisplay       As String
  1452.    
  1453.    Dim i                As Integer
  1454.    
  1455.    strResult = ""
  1456.    strDisplay = ""
  1457.    
  1458.    strDisplay = strDisplay & "Number of directories in C:\ is " & cCountDirectories("C:\*.*") & vbCrLf & vbCrLf
  1459.    strDisplay = strDisplay & "Number of directories in D:\ is " & cCountDirectories("D:\*.*") & vbCrLf & vbCrLf
  1460.    strDisplay = strDisplay & "Number of directories in E:\ is " & cCountDirectories("E:\*.*") & vbCrLf & vbCrLf
  1461.    
  1462.    txt_Result = strDisplay
  1463.  
  1464.    'time the function
  1465.  
  1466.    TimerHandle = cTimerOpen()
  1467.    TimerStartOk = cTimerStart(TimerHandle)
  1468.    
  1469.    For i = 1 To Iteration
  1470.       lResult = cCountDirectories("C:\*.*")
  1471.    Next i
  1472.    
  1473.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1474.    
  1475.    TimerCloseOk = cTimerClose(TimerHandle)
  1476.  
  1477. End Sub
  1478.  
  1479. Private Sub TestFilesSizeX()
  1480.  
  1481.    Dim lResult          As Long
  1482.    Dim strResult        As String
  1483.    Dim strDisplay       As String
  1484.    
  1485.    Dim i                As Long
  1486.    
  1487.    Dim Size1            As Double
  1488.    Dim Size2            As Double
  1489.    
  1490.    strResult = ""
  1491.    strDisplay = ""
  1492.    
  1493.    strDisplay = strDisplay & "Size of files c:\* is " & cFilesSize("c:\*.*") & vbCrLf
  1494.    strDisplay = strDisplay & "Size of files c:\*.bat is " & cFilesSize("c:\*.bat") & vbCrLf
  1495.    strDisplay = strDisplay & "Size of files c:\*.sys is " & cFilesSize("c:\*.sys") & vbCrLf
  1496.    strDisplay = strDisplay & "Size of files c:\*.com is " & cFilesSize("c:\*.com") & vbCrLf
  1497.    strDisplay = strDisplay & vbCrLf
  1498.    strDisplay = strDisplay & "Size of files c:\* on disk is " & cFilesSizeOnDisk("c:\*.*") & vbCrLf
  1499.    strDisplay = strDisplay & "Size of files c:\*.bat on disk is " & cFilesSizeOnDisk("c:\*.bat") & vbCrLf
  1500.    strDisplay = strDisplay & "Size of files c:\*.sys on disk is " & cFilesSizeOnDisk("c:\*.sys") & vbCrLf
  1501.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cFilesSizeOnDisk("c:\*.com") & vbCrLf
  1502.    strDisplay = strDisplay & vbCrLf
  1503.    strDisplay = strDisplay & "Slack of files c:\* on disk is " & cFilesSlack("c:\*.*", Size1, Size2) & " %" & vbCrLf
  1504.    strDisplay = strDisplay & "Slack of files c:\*.bat on disk is " & cFilesSlack("c:\*.bat", Size1, Size2) & " %" & vbCrLf
  1505.    strDisplay = strDisplay & "Slack of files c:\*.sys on disk is " & cFilesSlack("c:\*.sys", Size1, Size2) & " %" & vbCrLf
  1506.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cFilesSlack("c:\*.com", Size1, Size2) & " %" & vbCrLf
  1507.  
  1508.    txt_Result = strDisplay
  1509.  
  1510.    'time the function
  1511.  
  1512.    TimerHandle = cTimerOpen()
  1513.    TimerStartOk = cTimerStart(TimerHandle)
  1514.    
  1515.    For i = 1 To Iteration
  1516.       lResult = cFilesSize("c:\*.*")
  1517.    Next i
  1518.    
  1519.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1520.    
  1521.    TimerCloseOk = cTimerClose(TimerHandle)
  1522.  
  1523. End Sub
  1524.  
  1525. Private Sub TestRcsFilesSizeX()
  1526.  
  1527.    Dim lResult          As Long
  1528.    Dim strResult        As String
  1529.    Dim strDisplay       As String
  1530.    
  1531.    Dim i                As Long
  1532.    
  1533.    Dim Size1            As Double
  1534.    Dim Size2            As Double
  1535.    
  1536.    strResult = ""
  1537.    strDisplay = ""
  1538.    
  1539.    'For i = 67 To 70
  1540.    '
  1541.    '   strDisplay = strDisplay & "Total directories in " & Chr$(i) & ": is " & cRcsCountFileDir(False, Chr$(i) & ":", "", True) & vbCrLf
  1542.    '   strDisplay = strDisplay & "Total files in " & Chr$(i) & ": is " & cRcsCountFileDir(True, Chr$(i) & ":", "", True) & vbCrLf
  1543.    '   strDisplay = strDisplay & "Size of files " & Chr$(i) & ": is " & cRcsFilesSize(Chr$(i) & ":\", "*.*", True) & vbCrLf
  1544.    '   strDisplay = strDisplay & "Size of files " & Chr$(i) & ": on disk is " & cRcsFilesSizeOnDisk(Chr$(i) & ":\", "*.*", True) & vbCrLf
  1545.    '   strDisplay = strDisplay & "Slack of files starting with " & Chr$(i) & ": on disk is " & cRcsFilesSlack(Chr$(i) & ":\", "*.*", True, Size1, Size2) & " %" & vbCrLf & vbCrLf
  1546.    '
  1547.    'Next i
  1548.    '
  1549.    'txt_Result = strDisplay
  1550.    'Exit Sub
  1551.       
  1552.    strDisplay = strDisplay & "Size of files c:\* is " & cRcsFilesSize("c:\", "*", False) & vbCrLf
  1553.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", False) & vbCrLf
  1554.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", False) & vbCrLf
  1555.    strDisplay = strDisplay & vbCrLf
  1556.    strDisplay = strDisplay & "Size of files c:\* on disk is " & cRcsFilesSizeOnDisk("c:\", "*", False) & vbCrLf
  1557.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", False) & vbCrLf
  1558.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", False) & vbCrLf
  1559.    strDisplay = strDisplay & vbCrLf
  1560.    strDisplay = strDisplay & "Slack of files c:\* on disk is " & cRcsFilesSlack("c:\", "*", False, Size1, Size2) & " %" & vbCrLf
  1561.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", False, Size1, Size2) & " %" & vbCrLf
  1562.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", False, Size1, Size2) & " %" & vbCrLf
  1563.  
  1564.    strDisplay = strDisplay & vbCrLf
  1565.  
  1566.    strDisplay = strDisplay & "Size of files c:\* is " & cRcsFilesSize("c:\", "*", True) & vbCrLf
  1567.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", True) & vbCrLf
  1568.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", True) & vbCrLf
  1569.    strDisplay = strDisplay & vbCrLf
  1570.    strDisplay = strDisplay & "Size of files c:\* on disk is " & cRcsFilesSizeOnDisk("c:\", "*", True) & vbCrLf
  1571.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", True) & vbCrLf
  1572.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", True) & vbCrLf
  1573.    strDisplay = strDisplay & vbCrLf
  1574.    strDisplay = strDisplay & "Slack of files c:\* on disk is " & cRcsFilesSlack("c:\", "*", True, Size1, Size2) & " %" & vbCrLf
  1575.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", True, Size1, Size2) & " %" & vbCrLf
  1576.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", True, Size1, Size2) & " %" & vbCrLf
  1577.  
  1578.    txt_Result = strDisplay
  1579.  
  1580.    'time the function
  1581.  
  1582.    TimerHandle = cTimerOpen()
  1583.    TimerStartOk = cTimerStart(TimerHandle)
  1584.    
  1585.    For i = 1 To Iteration
  1586.       lResult = cRcsFilesSize("c:\", "*", False)
  1587.    Next i
  1588.    
  1589.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1590.    
  1591.    TimerCloseOk = cTimerClose(TimerHandle)
  1592.  
  1593. End Sub
  1594.  
  1595. Private Sub TestTruncatePath()
  1596.  
  1597.    Dim intResult        As Integer
  1598.    Dim strResult        As String
  1599.    Dim strDisplay       As String
  1600.    
  1601.    Dim i                As Integer
  1602.    
  1603.    Dim File1            As String
  1604.    
  1605.    strResult = ""
  1606.    strDisplay = ""
  1607.    
  1608.    strDisplay = strDisplay & "Truncate the following path with a length of 25" & vbCrLf & vbCrLf
  1609.  
  1610.    File1 = "t2win-16.bas"
  1611.    strResult = cTruncatePath(File1, 25)
  1612.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1613.  
  1614.    File1 = "windows\system\t2win-16.bas"
  1615.    strResult = cTruncatePath(File1, 25)
  1616.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1617.  
  1618.    File1 = cGetSystemDirectory & "\t2win-16.bas"
  1619.    strResult = cTruncatePath(File1, 25)
  1620.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1621.  
  1622.    File1 = cGetSystemDirectory & "\visual\t2win-16\t2win-16.bas"
  1623.    strResult = cTruncatePath(File1, 25)
  1624.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1625.  
  1626.    File1 = cGetSystemDirectory & "\visual\source\t2win-16\t2win-16.bas"
  1627.    strResult = cTruncatePath(File1, 25)
  1628.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1629.  
  1630.    strDisplay = strDisplay & "Truncate the following path with a length of 35" & vbCrLf & vbCrLf
  1631.  
  1632.    File1 = "t2win-16.bas"
  1633.    strResult = cTruncatePath(File1, 35)
  1634.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1635.  
  1636.    File1 = "windows\system\t2win-16.bas"
  1637.    strResult = cTruncatePath(File1, 35)
  1638.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1639.  
  1640.    File1 = cGetSystemDirectory & "\t2win-16.bas"
  1641.    strResult = cTruncatePath(File1, 35)
  1642.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1643.  
  1644.    File1 = cGetSystemDirectory & "\visual\t2win-16\t2win-16.bas"
  1645.    strResult = cTruncatePath(File1, 35)
  1646.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1647.  
  1648.    File1 = cGetSystemDirectory & "\visual\source\t2win-16\t2win-16.bas"
  1649.    strResult = cTruncatePath(File1, 35)
  1650.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1651.      
  1652.    txt_Result = strDisplay
  1653.  
  1654.    'time the function
  1655.  
  1656.    TimerHandle = cTimerOpen()
  1657.    TimerStartOk = cTimerStart(TimerHandle)
  1658.    
  1659.    For i = 1 To Iteration
  1660.       strResult = cTruncatePath(File1, 35)
  1661.    Next i
  1662.    
  1663.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1664.    
  1665.    TimerCloseOk = cTimerClose(TimerHandle)
  1666.  
  1667. End Sub
  1668.  
  1669. Private Sub TestMakeSplitPath()
  1670.  
  1671.    Dim intResult        As Integer
  1672.    Dim strResult        As String
  1673.    Dim strDisplay       As String
  1674.    
  1675.    Dim i                As Integer
  1676.    
  1677.    Dim SPLITPATH        As tagSPLITPATH
  1678.  
  1679.    Dim File1            As String
  1680.    
  1681.    strResult = ""
  1682.    strDisplay = ""
  1683.    
  1684.    File1 = cMakePath("c", "\this is a test", "test", "dat")
  1685.    
  1686.    strDisplay = strDisplay & "Make Path of (c,\this is a test,test,dat) is '" & File1 & "'" & vbCrLf & vbCrLf
  1687.    
  1688.    strDisplay = strDisplay & "Split Path '" & File1 & "' into four components is :" & vbCrLf & vbCrLf
  1689.    intResult = cSplitPath(File1, SPLITPATH)
  1690.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDrive & vbCrLf
  1691.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDir & vbCrLf
  1692.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nName & vbCrLf
  1693.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nExt & vbCrLf & vbCrLf
  1694.    
  1695.    txt_Result = strDisplay
  1696.  
  1697.    'time the function
  1698.  
  1699.    TimerHandle = cTimerOpen()
  1700.    TimerStartOk = cTimerStart(TimerHandle)
  1701.    
  1702.    For i = 1 To Iteration
  1703.       strResult = cMakePath("c", "this is a test", "test", "dat")
  1704.    Next i
  1705.    
  1706.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1707.    
  1708.    TimerCloseOk = cTimerClose(TimerHandle)
  1709.  
  1710. End Sub
  1711.  
  1712. Private Sub TestFullPath()
  1713.  
  1714.    Dim intResult        As Integer
  1715.    Dim strResult        As String
  1716.    Dim strDisplay       As String
  1717.    
  1718.    Dim i                As Integer
  1719.    
  1720.    Dim File1            As String
  1721.    
  1722.    strResult = ""
  1723.    strDisplay = ""
  1724.    
  1725.    File1 = T2WFileTest
  1726.  
  1727.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1728.  
  1729.    File1 = cGetSystemDirectory() & "\t2win-32.dll"
  1730.  
  1731.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1732.  
  1733.    File1 = cFilesInDirectory(cGetDefaultCurrentDir() + "\*.*", True)
  1734.  
  1735.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1736.    
  1737.    txt_Result = strDisplay
  1738.  
  1739.    'time the function
  1740.  
  1741.    TimerHandle = cTimerOpen()
  1742.    TimerStartOk = cTimerStart(TimerHandle)
  1743.    
  1744.    For i = 1 To Iteration
  1745.       strResult = cFullPath(File1)
  1746.    Next i
  1747.    
  1748.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1749.    
  1750.    TimerCloseOk = cTimerClose(TimerHandle)
  1751.  
  1752. End Sub
  1753.  
  1754. Private Sub TestRenameFile()
  1755.  
  1756.    Dim intResult        As Integer
  1757.    Dim strResult        As String
  1758.    Dim strDisplay       As String
  1759.    
  1760.    Dim i                As Integer
  1761.    
  1762.    Dim File1            As String
  1763.    Dim File2            As String
  1764.    
  1765.    strResult = ""
  1766.    strDisplay = ""
  1767.    
  1768.    File1 = "this.is.a.test.~~~"
  1769.    File2 = "an another test.---"
  1770.    
  1771.    intResult = cKillFile(File1)
  1772.    intResult = cKillFile(File2)
  1773.    
  1774.    Close #1
  1775.    Open File1 For Output Shared As #1
  1776.    Print #1, File1
  1777.    Print #1, File2
  1778.    Close #1
  1779.  
  1780.    strDisplay = "File '" & File1 & "' " & IIf(cRenameFile(File1, File2) = True, "renamed in '" & File2 & "'", "is not renamed") & vbCrLf & vbCrLf
  1781.  
  1782.    txt_Result = strDisplay
  1783.  
  1784.    'time the function
  1785.  
  1786.    TimerHandle = cTimerOpen()
  1787.    TimerStartOk = cTimerStart(TimerHandle)
  1788.    
  1789.    For i = 1 To Iteration
  1790.       intResult = cRenameFile(File1, File2)
  1791.    Next i
  1792.    
  1793.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1794.    
  1795.    TimerCloseOk = cTimerClose(TimerHandle)
  1796.  
  1797. End Sub
  1798.  
  1799. Public Sub TestUniqueFileName()
  1800.  
  1801.    Dim intResult        As Integer
  1802.    Dim strResult        As String
  1803.    Dim strDisplay       As String
  1804.    
  1805.    Dim i                As Integer
  1806.    
  1807.    Dim File1            As String
  1808.    
  1809.    strResult = ""
  1810.    strDisplay = ""
  1811.    
  1812.    File1 = "WN"
  1813.  
  1814.    strDisplay = strDisplay + "Generate unique filename with template '" & File1 & "' is '" & cUniqueFileName(File1) & "'" & vbCrLf & vbCrLf
  1815.    
  1816.    txt_Result = strDisplay
  1817.  
  1818.    'time the function
  1819.  
  1820.    TimerHandle = cTimerOpen()
  1821.    TimerStartOk = cTimerStart(TimerHandle)
  1822.    
  1823.    For i = 1 To Iteration
  1824.       strResult = cUniqueFileName(File1)
  1825.    Next i
  1826.    
  1827.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1828.    
  1829.    TimerCloseOk = cTimerClose(TimerHandle)
  1830.  
  1831. End Sub
  1832.  
  1833. Private Sub TestFilesInDirectory()
  1834.  
  1835.    Dim intResult        As Integer
  1836.    Dim strResult        As String
  1837.    Dim strDisplay       As String
  1838.    
  1839.    Dim i                As Integer
  1840.    
  1841.    Dim File1            As String
  1842.    
  1843.    strResult = ""
  1844.    strDisplay = ""
  1845.    
  1846.    File1 = "*.*"
  1847.  
  1848.    strDisplay = strDisplay + "The 10 first files in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1849.  
  1850.    strResult = cFilesInDirectory(File1, True)
  1851.    For i = 1 To 15
  1852.       strDisplay = strDisplay & strResult & vbCrLf
  1853.       strResult = cFilesInDirectory(File1, False)
  1854.    Next i
  1855.    
  1856.    strDisplay = strDisplay + vbCrLf
  1857.  
  1858.    File1 = "C:\*.*"
  1859.  
  1860.    strDisplay = strDisplay + "The 10 first files in '" & File1 & "'" & vbCrLf & vbCrLf
  1861.  
  1862.    strResult = cFilesInDirectory(File1, True)
  1863.    For i = 1 To 10
  1864.       strDisplay = strDisplay & strResult & vbCrLf
  1865.       strResult = cFilesInDirectory(File1, False)
  1866.    Next i
  1867.    
  1868.    txt_Result = strDisplay
  1869.  
  1870.    'time the function
  1871.  
  1872.    TimerHandle = cTimerOpen()
  1873.    TimerStartOk = cTimerStart(TimerHandle)
  1874.    
  1875.    For i = 1 To Iteration
  1876.       strResult = cFilesInDirectory(File1, True)
  1877.    Next i
  1878.    
  1879.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1880.    
  1881.    TimerCloseOk = cTimerClose(TimerHandle)
  1882.  
  1883. End Sub
  1884.  
  1885. Private Sub TestSubDirectory()
  1886.  
  1887.    Dim intResult        As Integer
  1888.    Dim strResult        As String
  1889.    Dim strDisplay       As String
  1890.    
  1891.    Dim i                As Integer
  1892.    
  1893.    Dim File1            As String
  1894.    
  1895.    strResult = ""
  1896.    strDisplay = ""
  1897.    
  1898.    File1 = "*.*"
  1899.  
  1900.    strDisplay = strDisplay + "The 10 first directory in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1901.  
  1902.    strResult = cSubDirectory(File1, True)
  1903.    For i = 1 To 10
  1904.       strDisplay = strDisplay & strResult & vbCrLf
  1905.       strResult = cSubDirectory(File1, False)
  1906.    Next i
  1907.    
  1908.    strDisplay = strDisplay + vbCrLf
  1909.  
  1910.    File1 = "C:\*.*"
  1911.  
  1912.    strDisplay = strDisplay + "The 10 first directory in '" & File1 & "'" & vbCrLf & vbCrLf
  1913.  
  1914.    strResult = cSubDirectory(File1, True)
  1915.    For i = 1 To 10
  1916.       strDisplay = strDisplay & strResult & vbCrLf
  1917.       strResult = cSubDirectory(File1, False)
  1918.    Next i
  1919.    
  1920.    txt_Result = strDisplay
  1921.  
  1922.    'time the function
  1923.  
  1924.    TimerHandle = cTimerOpen()
  1925.    TimerStartOk = cTimerStart(TimerHandle)
  1926.    
  1927.    For i = 1 To Iteration
  1928.       strResult = cSubDirectory(File1, True)
  1929.    Next i
  1930.    
  1931.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1932.    
  1933.    TimerCloseOk = cTimerClose(TimerHandle)
  1934.  
  1935. End Sub
  1936.  
  1937. Private Sub TestFileGetAttribute()
  1938.  
  1939.    Dim intResult        As Integer
  1940.    Dim strResult        As String
  1941.    Dim strDisplay       As String
  1942.    
  1943.    Dim i                As Integer
  1944.    
  1945.    Dim File1            As String
  1946.    
  1947.    Dim FileAttrib       As FileAttributeType
  1948.  
  1949.    strResult = ""
  1950.    strDisplay = ""
  1951.    
  1952.    File1 = cFilesInDirectory("*.*", True)
  1953.    intResult = cFileGetAttrib(File1, FileAttrib)
  1954.  
  1955.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1956.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1957.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1958.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1959.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1960.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1961.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1962.      
  1963.    File1 = cGetWindowsDirectory() & "\user.dat"
  1964.    intResult = cFileGetAttrib(File1, FileAttrib)
  1965.    
  1966.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1967.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1968.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1969.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1970.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1971.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1972.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1973.      
  1974.    File1 = cSubDirectory("c:\*.*", True)
  1975.    File1 = cSubDirectory("c:\*.*", False)
  1976.    File1 = cSubDirectory("c:\*.*", False)
  1977.    File1 = "c:\" & File1
  1978.    intResult = cFileGetAttrib(File1, FileAttrib)
  1979.    
  1980.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1981.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1982.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1983.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1984.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1985.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1986.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1987.      
  1988.    txt_Result = strDisplay
  1989.  
  1990.    'time the function
  1991.  
  1992.    TimerHandle = cTimerOpen()
  1993.    TimerStartOk = cTimerStart(TimerHandle)
  1994.    
  1995.    For i = 1 To Iteration
  1996.       intResult = cFileGetAttrib(File1, FileAttrib)
  1997.    Next i
  1998.    
  1999.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2000.    
  2001.    TimerCloseOk = cTimerClose(TimerHandle)
  2002.  
  2003. End Sub
  2004.  
  2005. Private Sub TestFileSetAttribute()
  2006.  
  2007.    Dim intResult        As Integer
  2008.    Dim strResult        As String
  2009.    Dim strDisplay       As String
  2010.    
  2011.    Dim i                As Integer
  2012.    
  2013.    Dim File1            As String
  2014.    
  2015.    Dim FileAttrib       As FileAttributeType
  2016.  
  2017.    strResult = ""
  2018.    strDisplay = ""
  2019.    
  2020.    File1 = cFilesInDirectory("*.*", True)
  2021.    intResult = cFileGetAttrib(File1, FileAttrib)
  2022.  
  2023.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2024.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2025.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2026.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2027.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2028.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2029.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2030.    
  2031.    FileAttrib.Archive = False
  2032.    FileAttrib.Hidden = True
  2033.    FileAttrib.ReadOnly = True
  2034.    FileAttrib.System = True
  2035.    
  2036.    intResult = cFileSetAttrib(File1, FileAttrib)
  2037.    
  2038.    strDisplay = strDisplay & "Setting attribute (not archive, hidden, readonly, system) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  2039.      
  2040.    intResult = cFileGetAttrib(File1, FileAttrib)
  2041.    
  2042.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2043.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2044.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2045.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2046.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2047.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2048.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2049.  
  2050.    txt_Result = strDisplay
  2051.  
  2052.    'time the function
  2053.  
  2054.    TimerHandle = cTimerOpen()
  2055.    TimerStartOk = cTimerStart(TimerHandle)
  2056.    
  2057.    For i = 1 To Iteration
  2058.       intResult = cFileSetAttrib(File1, FileAttrib)
  2059.    Next i
  2060.    
  2061.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2062.    
  2063.    TimerCloseOk = cTimerClose(TimerHandle)
  2064.  
  2065. End Sub
  2066.  
  2067. Private Sub TestFileSetAllAttributes()
  2068.  
  2069.    Dim intResult        As Integer
  2070.    Dim strResult        As String
  2071.    Dim strDisplay       As String
  2072.    
  2073.    Dim i                As Integer
  2074.    
  2075.    Dim File1            As String
  2076.    
  2077.    Dim FileAttrib       As FileAttributeType
  2078.  
  2079.    strResult = ""
  2080.    strDisplay = ""
  2081.    
  2082.    File1 = cFilesInDirectory("*.*", True)
  2083.    intResult = cFileGetAttrib(File1, FileAttrib)
  2084.  
  2085.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2086.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2087.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2088.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2089.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2090.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2091.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2092.    
  2093.    intResult = cFileSetAllAttrib(File1)
  2094.    
  2095.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  2096.      
  2097.    intResult = cFileGetAttrib(File1, FileAttrib)
  2098.    
  2099.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2100.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2101.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2102.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2103.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2104.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2105.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2106.  
  2107.    txt_Result = strDisplay
  2108.  
  2109.    'time the function
  2110.  
  2111.    TimerHandle = cTimerOpen()
  2112.    TimerStartOk = cTimerStart(TimerHandle)
  2113.    
  2114.    For i = 1 To Iteration
  2115.       intResult = cFileSetAllAttrib(File1)
  2116.    Next i
  2117.    
  2118.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2119.    
  2120.    TimerCloseOk = cTimerClose(TimerHandle)
  2121.  
  2122. End Sub
  2123.  
  2124. Public Sub TestFileResetAllAttributes()
  2125.  
  2126.    Dim intResult        As Integer
  2127.    Dim strResult        As String
  2128.    Dim strDisplay       As String
  2129.    
  2130.    Dim i                As Integer
  2131.    
  2132.    Dim File1            As String
  2133.    
  2134.    Dim FileAttrib       As FileAttributeType
  2135.  
  2136.    strResult = ""
  2137.    strDisplay = ""
  2138.    
  2139.    File1 = cFilesInDirectory("*.*", True)
  2140.    intResult = cFileGetAttrib(File1, FileAttrib)
  2141.  
  2142.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2143.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2144.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2145.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2146.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2147.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2148.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2149.    
  2150.    intResult = cFileResetAllAttrib(File1)
  2151.    
  2152.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  2153.      
  2154.    intResult = cFileGetAttrib(File1, FileAttrib)
  2155.    
  2156.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2157.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2158.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2159.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2160.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2161.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2162.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2163.  
  2164.    txt_Result = strDisplay
  2165.  
  2166.    'time the function
  2167.  
  2168.    TimerHandle = cTimerOpen()
  2169.    TimerStartOk = cTimerStart(TimerHandle)
  2170.    
  2171.    For i = 1 To Iteration
  2172.       intResult = cFileResetAllAttrib(File1)
  2173.    Next i
  2174.    
  2175.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2176.    
  2177.    TimerCloseOk = cTimerClose(TimerHandle)
  2178.  
  2179. End Sub
  2180.  
  2181. Public Sub TestFileCompareX()
  2182.  
  2183.    Dim intResult        As Integer
  2184.    Dim strResult        As String
  2185.    Dim strDisplay       As String
  2186.    
  2187.    Dim i                As Integer
  2188.    
  2189.    Dim File1            As String
  2190.    Dim File2            As String
  2191.    
  2192.    Dim FileAttrib       As FileAttributeType
  2193.  
  2194.    strResult = ""
  2195.    strDisplay = ""
  2196.    
  2197.    File1 = T2WFileTest
  2198.    File2 = "autoexec.compare"
  2199.    
  2200.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  2201.    
  2202.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  2203.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  2204.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  2205.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  2206.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  2207.      
  2208.    Close #1
  2209.    Open File2 For Append Shared As #1
  2210.    Print #1, File2
  2211.    Close #1
  2212.      
  2213.    strDisplay = strDisplay & "Appending " & (Len(File2) + 2) & " chars to '" & File2 & "'" & vbCrLf & vbCrLf
  2214.    
  2215.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  2216.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  2217.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  2218.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  2219.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  2220.      
  2221.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) is " & cFileResetAllAttrib(File2) & vbCrLf & vbCrLf
  2222.    
  2223.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  2224.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  2225.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  2226.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  2227.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  2228.      
  2229.    txt_Result = strDisplay
  2230.  
  2231.    'time the function
  2232.  
  2233.    TimerHandle = cTimerOpen()
  2234.    TimerStartOk = cTimerStart(TimerHandle)
  2235.    
  2236.    For i = 1 To Iteration
  2237.       intResult = cCmpFileSize(File1, File2)
  2238.    Next i
  2239.    
  2240.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2241.    
  2242.    TimerCloseOk = cTimerClose(TimerHandle)
  2243.  
  2244. End Sub
  2245.  
  2246. Private Sub TestFileDrive()
  2247.  
  2248.    Dim intResult        As Integer
  2249.    Dim strResult        As String
  2250.    Dim strDisplay       As String
  2251.    
  2252.    Dim i                As Integer
  2253.    
  2254.    Dim File1            As String
  2255.    
  2256.    strResult = ""
  2257.    strDisplay = ""
  2258.    
  2259.    File1 = T2WFileTest
  2260.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  2261.    
  2262.    File1 = cGetWindowsDirectory() + "\user.dat"
  2263.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  2264.    
  2265.    txt_Result = strDisplay
  2266.  
  2267.    'time the function
  2268.  
  2269.    TimerHandle = cTimerOpen()
  2270.    TimerStartOk = cTimerStart(TimerHandle)
  2271.    
  2272.    For i = 1 To Iteration
  2273.       strResult = cFileDrive(File1)
  2274.    Next i
  2275.    
  2276.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2277.    
  2278.    TimerCloseOk = cTimerClose(TimerHandle)
  2279.  
  2280. End Sub
  2281.  
  2282. Private Sub TestFilesInDirOnDisk()
  2283.  
  2284.    Dim lResult          As Long
  2285.    Dim strResult        As String
  2286.    Dim strDisplay       As String
  2287.    
  2288.    Dim i                As Integer
  2289.    
  2290.    Dim File1            As String
  2291.    Dim File2            As String
  2292.    
  2293.    strResult = ""
  2294.    strDisplay = ""
  2295.    
  2296.    File1 = "filesindirondisk.temp"
  2297.    File2 = "c:\*.*"
  2298.    
  2299.    strDisplay = strDisplay & "Number of files '" & File2 & "' (with at least one of the following attribute)" & vbCrLf & vbCrLf
  2300.  
  2301.    strDisplay = strDisplay & "Any : " & cFilesInDirOnDisk(File1, File2, A_ALL) & vbCrLf
  2302.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL) & vbCrLf
  2303.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL_ARCHIVE) & vbCrLf
  2304.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE) & vbCrLf
  2305.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE Or A_RDONLY) & vbCrLf
  2306.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_SYSTEM Or A_HIDDEN Or A_RDONLY) & vbCrLf
  2307.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_HIDDEN Or A_RDONLY) & vbCrLf
  2308.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_RDONLY) & vbCrLf
  2309.    strDisplay = strDisplay & vbCrLf
  2310.  
  2311.    strDisplay = strDisplay & "Number of files in '" & File2 & "' (with exact attribute excluding all others)" & vbCrLf & vbCrLf
  2312.  
  2313.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL)) & vbCrLf
  2314.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL_ARCHIVE)) & vbCrLf
  2315.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE)) & vbCrLf
  2316.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE Or A_RDONLY)) & vbCrLf
  2317.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  2318.    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
  2319.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_HIDDEN Or A_RDONLY)) & vbCrLf
  2320.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_RDONLY)) & vbCrLf
  2321.    strDisplay = strDisplay & vbCrLf
  2322.    
  2323.    txt_Result = strDisplay
  2324.  
  2325.    'time the function
  2326.  
  2327.    TimerHandle = cTimerOpen()
  2328.    TimerStartOk = cTimerStart(TimerHandle)
  2329.    
  2330.    For i = 1 To Iteration
  2331.       lResult = cFilesInDirOnDisk(File1, File2, A_ALL)
  2332.    Next i
  2333.    
  2334.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2335.    
  2336.    TimerCloseOk = cTimerClose(TimerHandle)
  2337.  
  2338. End Sub
  2339.  
  2340. Private Sub TestFileDateTime()
  2341.  
  2342.    Dim intResult        As Integer
  2343.    Dim strResult        As String
  2344.    Dim strDisplay       As String
  2345.    
  2346.    Dim i                As Integer
  2347.    
  2348.    Dim File1            As String
  2349.    
  2350.    strResult = ""
  2351.    strDisplay = ""
  2352.    
  2353.    File1 = T2WFileTest
  2354.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2355.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2356.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2357.    
  2358.    File1 = "c:\config.sys"
  2359.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2360.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2361.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2362.    
  2363.    File1 = cGetSystemDirectory() + "\t2win-32.dll"
  2364.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2365.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2366.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2367.    
  2368.    File1 = cGetWindowsDirectory() + "\user.dat"
  2369.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2370.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2371.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2372.    
  2373.    txt_Result = strDisplay
  2374.  
  2375.    'time the function
  2376.  
  2377.    TimerHandle = cTimerOpen()
  2378.    TimerStartOk = cTimerStart(TimerHandle)
  2379.    
  2380.    For i = 1 To Iteration
  2381.       strResult = cFileDateCreated(File1)
  2382.    Next i
  2383.    
  2384.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2385.    
  2386.    TimerCloseOk = cTimerClose(TimerHandle)
  2387.  
  2388. End Sub
  2389.  
  2390. Private Sub TestFileStatistics()
  2391.  
  2392.    Dim lResult          As Long
  2393.    Dim strResult        As String
  2394.    Dim strDisplay       As String
  2395.    
  2396.    Dim i                As Integer
  2397.    
  2398.    Dim nL               As Long
  2399.    Dim nW               As Long
  2400.    Dim nC               As Long
  2401.    
  2402.    Dim File1            As String
  2403.    
  2404.    strResult = ""
  2405.    strDisplay = ""
  2406.    
  2407.    File1 = T2WFileTest
  2408.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  2409.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  2410.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  2411.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  2412.  
  2413.    File1 = "c:\config.sys"
  2414.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  2415.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  2416.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  2417.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  2418.  
  2419.    txt_Result = strDisplay
  2420.  
  2421.    'time the function
  2422.  
  2423.    TimerHandle = cTimerOpen()
  2424.    TimerStartOk = cTimerStart(TimerHandle)
  2425.    
  2426.    For i = 1 To Iteration
  2427.       lResult = cFileStatistics(File1, nL, nW, nC)
  2428.    Next i
  2429.    
  2430.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2431.    
  2432.    TimerCloseOk = cTimerClose(TimerHandle)
  2433.  
  2434. End Sub
  2435.  
  2436. Private Sub TestGetDriveType()
  2437.  
  2438.    Dim intResult        As Integer
  2439.    Dim strResult        As String
  2440.    Dim strDisplay       As String
  2441.    
  2442.    Dim i                As Integer
  2443.    
  2444.    strResult = ""
  2445.    strDisplay = ""
  2446.    
  2447.    For i = 1 To 26
  2448.       intResult = cGetDriveType(Chr$(64 + i))
  2449.       If (intResult > 0) Then
  2450.          strDisplay = strDisplay & "'" & Chr$(64 + i) & ":' is "
  2451.          Select Case intResult
  2452.             Case DRIVE_UNKNOWN
  2453.                strDisplay = strDisplay & "(unknown)" & vbCrLf
  2454.             Case DRIVE_NO_ROOT_DIR
  2455.                strDisplay = strDisplay & "(not root dir)" & vbCrLf
  2456.             Case DRIVE_REMOVABLE
  2457.                strDisplay = strDisplay & "removable" & vbCrLf
  2458.             Case DRIVE_FIXED
  2459.                strDisplay = strDisplay & "fixed disk" & vbCrLf
  2460.             Case DRIVE_REMOTE
  2461.                strDisplay = strDisplay & "remote disk" & vbCrLf
  2462.             Case DRIVE_CDROM
  2463.                strDisplay = strDisplay & "cd-rom" & vbCrLf
  2464.             Case DRIVE_RAMDISK
  2465.                strDisplay = strDisplay & "ram disk" & vbCrLf
  2466.          End Select
  2467.       End If
  2468.    Next i
  2469.      
  2470.    txt_Result = strDisplay
  2471.  
  2472.    'time the function
  2473.  
  2474.    TimerHandle = cTimerOpen()
  2475.    TimerStartOk = cTimerStart(TimerHandle)
  2476.    
  2477.    For i = 1 To Iteration
  2478.       intResult = cGetDriveType("C")
  2479.    Next i
  2480.    
  2481.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2482.    
  2483.    TimerCloseOk = cTimerClose(TimerHandle)
  2484.  
  2485. End Sub
  2486.  
  2487. Private Sub TestPBFileCopy()
  2488.  
  2489.    Dim intResult        As Long
  2490.    Dim strResult        As String
  2491.    Dim strDisplay       As String
  2492.    
  2493.    Dim i                As Long
  2494.    
  2495.    Dim File1            As String
  2496.    Dim File2            As String
  2497.   
  2498.    strResult = ""
  2499.    strDisplay = ""
  2500.    
  2501.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  2502.    File2 = "system.pbcopy"
  2503.    
  2504.    strDisplay = strDisplay & "PB File Copy '" & File1 & "' to '" & File2 & "' is " & cPBFileCopy(Me.hWnd, File1, File2) & vbCrLf & vbCrLf
  2505.    
  2506.    txt_Result = strDisplay
  2507.  
  2508.    'time the function
  2509.       
  2510.    DoEvents
  2511.    
  2512.    TimerHandle = cTimerOpen()
  2513.    TimerStartOk = cTimerStart(TimerHandle)
  2514.    
  2515.    For i = 1 To Iteration
  2516.       intResult = cPBFileCopy(Me.hWnd, File1, File2)
  2517.       DoEvents
  2518.    Next i
  2519.    
  2520.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2521.    
  2522.    TimerCloseOk = cTimerClose(TimerHandle)
  2523.  
  2524. End Sub
  2525.  
  2526. Private Sub TestDBFileCopy()
  2527.  
  2528.    Dim intResult        As Integer
  2529.    Dim strResult        As String
  2530.    Dim strDisplay       As String
  2531.    
  2532.    Dim i                As Long
  2533.    
  2534.    Dim File1            As String
  2535.    Dim File2            As String
  2536.   
  2537.    strResult = ""
  2538.    strDisplay = ""
  2539.    
  2540.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  2541.    File2 = "system.dbcopy"
  2542.    
  2543.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  2544.    
  2545.    File1 = cGetWindowsDirectory() + "\" + "command.com"
  2546.    File2 = "command.dbcopy"
  2547.    
  2548.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  2549.    
  2550.    txt_Result = strDisplay
  2551.  
  2552.    'time the function
  2553.  
  2554.    DoEvents
  2555.    
  2556.    TimerHandle = cTimerOpen()
  2557.    TimerStartOk = cTimerStart(TimerHandle)
  2558.    
  2559.    For i = 1 To Iteration
  2560.       intResult = cDBFileCopy("", "", "", "", File1, File2)
  2561.       DoEvents
  2562.    Next i
  2563.    
  2564.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2565.    
  2566.    TimerCloseOk = cTimerClose(TimerHandle)
  2567.  
  2568. End Sub
  2569.  
  2570. Private Sub TestFileUUCP()
  2571.  
  2572.    Dim lResult          As Long
  2573.    Dim strResult        As String
  2574.    Dim strDisplay       As String
  2575.    
  2576.    Dim i                As Integer
  2577.    
  2578.    Dim File1            As String
  2579.    Dim File2            As String
  2580.    Dim File3            As String
  2581.    
  2582.    strResult = ""
  2583.    strDisplay = ""
  2584.    
  2585.    File1 = cGetWindowsDirectory() & "\system.dat"
  2586.    File2 = "system.uuencoded"
  2587.    File3 = "system.uudecoded"
  2588.    
  2589.    strDisplay = strDisplay & "File UUencode (without header) '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE, False) & vbCrLf
  2590.    strDisplay = strDisplay & "File UUdecode (without header) '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE, False) & vbCrLf
  2591.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  2592.  
  2593.    strDisplay = strDisplay & "File UUencode (with header) '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE, True) & vbCrLf
  2594.    strDisplay = strDisplay & "File UUdecode (with header) '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE, True) & vbCrLf
  2595.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  2596.  
  2597.    File1 = T2WFileTest
  2598.    File2 = "autoexec.uuencoded"
  2599.    File3 = "autoexec.uudecoded"
  2600.    
  2601.    strDisplay = strDisplay & "File UUencode (without header) '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE, False) & vbCrLf
  2602.    strDisplay = strDisplay & "File UUdecode (without header) '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE, False) & vbCrLf
  2603.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  2604.  
  2605.    strDisplay = strDisplay & "File UUencode (with header) '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE, True) & vbCrLf
  2606.    strDisplay = strDisplay & "File UUdecode (with header) '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE, True) & vbCrLf
  2607.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  2608.  
  2609.    txt_Result = strDisplay
  2610.  
  2611.    'time the function
  2612.  
  2613.    TimerHandle = cTimerOpen()
  2614.    TimerStartOk = cTimerStart(TimerHandle)
  2615.    
  2616.    For i = 1 To Iteration
  2617.       lResult = cFileUUCP(File1, File2, MODE_UUENCODE, True)
  2618.    Next i
  2619.    
  2620.    lResult = cFileUUCP(File2, File3, MODE_UUDECODE, True)
  2621.    
  2622.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2623.    
  2624.    TimerCloseOk = cTimerClose(TimerHandle)
  2625.  
  2626. End Sub
  2627.  
  2628. Private Sub TestOpenFiles(Mode As Integer)
  2629.  
  2630.    Dim intResult        As Integer
  2631.    Dim OpenFileName     As String
  2632.    Dim OpenFileMode     As Long
  2633.    Dim OpenFileType     As Long
  2634.    
  2635.    Dim strDisplay       As String
  2636.    
  2637.    Dim i                As Long
  2638.    
  2639.    strDisplay = ""
  2640.    
  2641.    i = -1
  2642.  
  2643.    TimerHandle = cTimerOpen()
  2644.    TimerStartOk = cTimerStart(TimerHandle)
  2645.    
  2646.    intResult = cEnumOpenFiles("C", Mode, True, OpenFileName, OpenFileMode, OpenFileType)
  2647.    
  2648.    strDisplay = "All open files on drive C are " & vbCrLf & vbCrLf
  2649.    
  2650.    While (intResult = NO_ERROR_OPEN_FILES)
  2651.       strDisplay = strDisplay + OpenFileName + " , " & OpenFileMode & " , " & OpenFileType & vbCrLf
  2652.       intResult = cEnumOpenFiles("C", Mode, False, OpenFileName, OpenFileMode, OpenFileType)
  2653.    Wend
  2654.    
  2655.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2656.    TimerCloseOk = cTimerClose(TimerHandle)
  2657.    
  2658.    txt_Result = strDisplay
  2659.    
  2660. End Sub
  2661.  
  2662. Private Sub TestSplitFile()
  2663.  
  2664.    Dim lResult          As Long
  2665.    Dim strResult        As String
  2666.    Dim strDisplay       As String
  2667.    
  2668.    Dim i                As Long
  2669.    Dim n                As Long
  2670.    
  2671.    Dim File1            As String
  2672.    Dim File2            As String
  2673.   
  2674.    strResult = ""
  2675.    strDisplay = ""
  2676.    
  2677.    File1 = cGetSystemDirectory() + "\VBA2.DLL"
  2678.    File2 = "vba2test"
  2679.  
  2680.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  2681.   
  2682.    n = cSplitFile(File1, File2, cFileSize(File1) \ 7) - 1
  2683.    strDisplay = strDisplay & "SplitFile '" & File1 & "' into part size of '" & (cFileSize(File1) \ 7) & "' bytes return '" & (n + 1) & "' file(s)" & vbCrLf & vbCrLf
  2684.    
  2685.    For i = 0 To n
  2686.       strResult = File2 & "." & Format$(i, "000")
  2687.       strDisplay = strDisplay & "FileSize of '" & strResult & "' is " & cFileSize(strResult) & vbCrLf
  2688.    Next i
  2689.    
  2690.    strDisplay = strDisplay & vbCrLf
  2691.    
  2692.    File1 = T2WFileTest
  2693.    File2 = "autoexec"
  2694.    
  2695.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  2696.   
  2697.    n = cSplitFile(File1, File2, 257) - 1
  2698.    strDisplay = strDisplay & "SplitFile '" & File1 & "' into part size of 257 bytes return '" & (n + 1) & "' file(s)" & vbCrLf & vbCrLf
  2699.    
  2700.    For i = 0 To n
  2701.       strResult = File2 & "." & Format$(i, "000")
  2702.       strDisplay = strDisplay & "FileSize of '" & strResult & "' is " & cFileSize(strResult) & vbCrLf
  2703.    Next i
  2704.    
  2705.    strDisplay = strDisplay & vbCrLf
  2706.    
  2707.    n = cSplitFile(File1, File2, 1025) - 1
  2708.    strDisplay = strDisplay & "SplitFile '" & File1 & "' into part size of 1025 bytes return '" & (n + 1) & "' file(s)" & vbCrLf & vbCrLf
  2709.    
  2710.    For i = 0 To n
  2711.       strResult = File2 & "." & Format$(i, "000")
  2712.       strDisplay = strDisplay & "FileSize of '" & strResult & "' is " & cFileSize(strResult) & vbCrLf
  2713.    Next i
  2714.    
  2715.    txt_Result = strDisplay
  2716.  
  2717.    'time the function
  2718.  
  2719.    TimerHandle = cTimerOpen()
  2720.    TimerStartOk = cTimerStart(TimerHandle)
  2721.    
  2722.    For i = 1 To Iteration
  2723.       lResult = cSplitFile(File1, File2, 257)
  2724.    Next i
  2725.    
  2726.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2727.    
  2728.    TimerCloseOk = cTimerClose(TimerHandle)
  2729.  
  2730. End Sub
  2731.  
  2732. Private Sub TestCutFile()
  2733.  
  2734.    Dim lResult          As Long
  2735.    Dim strResult        As String
  2736.    Dim strDisplay       As String
  2737.    
  2738.    Dim i                As Long
  2739.    Dim n                As Long
  2740.    
  2741.    Dim File1            As String
  2742.    Dim File2            As String
  2743.    Dim File3            As String
  2744.   
  2745.    strResult = ""
  2746.    strDisplay = ""
  2747.    
  2748.    File1 = cGetSystemDirectory() + "\VBA2.DLL"
  2749.    File2 = "vba2test.cut1"
  2750.    File3 = "vba2test.cut2"
  2751.    
  2752.    n = cFileSize(File1) * 1 / 4
  2753.    strDisplay = strDisplay & "CutFile '" & File1 & "' at position '" & n & "' to '" & File2 & "' and '" & File3 & "' is " & cCutFile(File1, File2, File3, n) & vbCrLf & vbCrLf
  2754.    
  2755.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf
  2756.    strDisplay = strDisplay & "FileSize of '" & File2 & "' is " & cFileSize(File2) & vbCrLf
  2757.    strDisplay = strDisplay & "FileSize of '" & File3 & "' is " & cFileSize(File3) & vbCrLf
  2758.  
  2759.    strDisplay = strDisplay & vbCrLf
  2760.  
  2761.    File1 = T2WFileTest
  2762.    File2 = "autoexec.cut1"
  2763.    File3 = "autoexec.cut2"
  2764.    
  2765.    n = cFileSize(File1) * 1 \ 4
  2766.    strDisplay = strDisplay & "CutFile '" & File1 & "' at position '" & n & "' to '" & File2 & "' and '" & File3 & "' is " & cCutFile(File1, File2, File3, n) & vbCrLf & vbCrLf
  2767.    
  2768.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf
  2769.    strDisplay = strDisplay & "FileSize of '" & File2 & "' is " & cFileSize(File2) & vbCrLf
  2770.    strDisplay = strDisplay & "FileSize of '" & File3 & "' is " & cFileSize(File3) & vbCrLf
  2771.  
  2772.    strDisplay = strDisplay & vbCrLf
  2773.  
  2774.    n = cFileSize(File1) * 3 \ 4
  2775.    strDisplay = strDisplay & "CutFile '" & File1 & "' at position '" & n & "' to '" & File2 & "' and '" & File3 & "' is " & cCutFile(File1, File2, File3, n) & vbCrLf & vbCrLf
  2776.    
  2777.    strDisplay = strDisplay & "FileSize of '" & File1 & "' is " & cFileSize(File1) & vbCrLf
  2778.    strDisplay = strDisplay & "FileSize of '" & File2 & "' is " & cFileSize(File2) & vbCrLf
  2779.    strDisplay = strDisplay & "FileSize of '" & File3 & "' is " & cFileSize(File3) & vbCrLf
  2780.  
  2781.    txt_Result = strDisplay
  2782.  
  2783.    'time the function
  2784.  
  2785.    TimerHandle = cTimerOpen()
  2786.    TimerStartOk = cTimerStart(TimerHandle)
  2787.    
  2788.    For i = 1 To Iteration
  2789.       lResult = cCutFile(File1, File2, File3, n)
  2790.    Next i
  2791.    
  2792.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2793.    
  2794.    TimerCloseOk = cTimerClose(TimerHandle)
  2795.  
  2796. End Sub
  2797.  
  2798. Private Sub TestGetFileDateTime()
  2799.  
  2800.    Dim intResult        As Integer
  2801.    Dim strDisplay       As String
  2802.    
  2803.    Dim SysCreation      As tagSYSTEMTIME
  2804.    Dim SysLastAccess    As tagSYSTEMTIME
  2805.    Dim SysLastWrite     As tagSYSTEMTIME
  2806.    
  2807.    Dim i                As Integer
  2808.    
  2809.    Dim File1            As String
  2810.    
  2811.    strDisplay = ""
  2812.    
  2813.    File1 = T2WFileTest
  2814.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  2815.  
  2816.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2817.    If (intResult <> True) Then
  2818.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2819.    Else
  2820.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  2821.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  2822.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  2823.    End If
  2824.    
  2825.    File1 = "c:\config.sys"
  2826.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  2827.  
  2828.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2829.    If (intResult <> True) Then
  2830.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2831.    Else
  2832.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  2833.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  2834.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  2835.    End If
  2836.   
  2837.    File1 = cGetSystemDirectory() + "\t2win-32.dll"
  2838.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  2839.  
  2840.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2841.    If (intResult <> True) Then
  2842.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2843.    Else
  2844.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  2845.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  2846.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  2847.    End If
  2848.    
  2849.    File1 = cGetWindowsDirectory() + "\user.dat"
  2850.    strDisplay = strDisplay & "File '" & File1 & "'" & vbCrLf
  2851.  
  2852.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2853.    If (intResult <> True) Then
  2854.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2855.    Else
  2856.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  2857.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  2858.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  2859.    End If
  2860.    
  2861.    txt_Result = strDisplay
  2862.  
  2863.    'time the function
  2864.  
  2865.    TimerHandle = cTimerOpen()
  2866.    TimerStartOk = cTimerStart(TimerHandle)
  2867.    
  2868.    For i = 1 To Iteration
  2869.       intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2870.    Next i
  2871.    
  2872.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2873.    
  2874.    TimerCloseOk = cTimerClose(TimerHandle)
  2875.  
  2876. End Sub
  2877.  
  2878. Private Sub TestSetFileDateTime()
  2879.  
  2880.    Dim intResult        As Integer
  2881.    Dim strDisplay       As String
  2882.    
  2883.    Dim SysCreation      As tagSYSTEMTIME
  2884.    Dim SysLastAccess    As tagSYSTEMTIME
  2885.    Dim SysLastWrite     As tagSYSTEMTIME
  2886.    Dim BckSysCreation   As tagSYSTEMTIME
  2887.    Dim BckSysLastAccess As tagSYSTEMTIME
  2888.    Dim BckSysLastWrite  As tagSYSTEMTIME
  2889.    
  2890.    Dim i                As Integer
  2891.    
  2892.    Dim File1            As String
  2893.    
  2894.    strDisplay = ""
  2895.    
  2896.    File1 = T2WFileTest
  2897.    strDisplay = strDisplay & "Get date & time information for file '" & File1 & "'" & vbCrLf
  2898.  
  2899.    intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2900.    If (intResult <> True) Then
  2901.       strDisplay = strDisplay & "   Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2902.    Else
  2903.       strDisplay = strDisplay & "   Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  2904.       strDisplay = strDisplay & "   Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  2905.       strDisplay = strDisplay & "   Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  2906.    End If
  2907.    
  2908.    Call cTypesCopy(SysCreation, BckSysCreation, Len(SysCreation))
  2909.    Call cTypesCopy(SysLastAccess, BckSysLastAccess, Len(SysLastAccess))
  2910.    Call cTypesCopy(SysLastWrite, BckSysLastWrite, Len(SysLastWrite))
  2911.    
  2912.    strDisplay = strDisplay & "Set actual date & time information for file '" & File1 & "'" & vbCrLf & vbCrLf
  2913.  
  2914.    SysCreation.wYear = Year(Now())
  2915.    SysCreation.wMonth = Month(Now())
  2916.    SysCreation.wDay = Day(Now())
  2917.    SysCreation.wHour = 23 'Hour(Now())
  2918.    SysCreation.wMinute = 0 'Minute(Now())
  2919.    SysCreation.wSecond = 0 'Second(Now())
  2920.    
  2921.    Call cTypesCopy(SysCreation, SysLastAccess, Len(SysCreation))
  2922.    Call cTypesCopy(SysCreation, SysLastWrite, Len(SysCreation))
  2923.    
  2924.    intResult = cSetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2925.    If (intResult <> True) Then
  2926.       strDisplay = strDisplay & "   Can't set date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2927.    Else
  2928.       strDisplay = strDisplay & "   Get actual date & time information for file '" & File1 & "'" & vbCrLf
  2929.       intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2930.       If (intResult <> True) Then
  2931.          strDisplay = strDisplay & "      Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2932.       Else
  2933.          strDisplay = strDisplay & "      Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  2934.          strDisplay = strDisplay & "      Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  2935.          strDisplay = strDisplay & "      Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  2936.       End If
  2937.    End If
  2938.    
  2939.    strDisplay = strDisplay & "Restore date & time information for file '" & File1 & "'" & vbCrLf & vbCrLf
  2940.    
  2941.    intResult = cSetFileDateTime(File1, BckSysCreation, BckSysLastAccess, BckSysLastWrite)
  2942.    If (intResult <> True) Then
  2943.       strDisplay = strDisplay & "   Can't restore date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2944.    Else
  2945.       strDisplay = strDisplay & "   Get actual date & time information for file '" & File1 & "'" & vbCrLf
  2946.       intResult = cGetFileDateTime(File1, SysCreation, SysLastAccess, SysLastWrite)
  2947.       If (intResult <> True) Then
  2948.          strDisplay = strDisplay & "      Can't get date & time information (error : " & intResult & ")" & vbCrLf & vbCrLf
  2949.       Else
  2950.          strDisplay = strDisplay & "      Creation : " & Format$(DateSerial(SysCreation.wYear, SysCreation.wMonth, SysCreation.wDay), "short date") & " " & Format$(TimeSerial(SysCreation.wHour, SysCreation.wMinute, SysCreation.wSecond), "hh:mm:ss") & vbCrLf
  2951.          strDisplay = strDisplay & "      Last Access : " & Format$(DateSerial(SysLastAccess.wYear, SysLastAccess.wMonth, SysLastAccess.wDay), "short date") & " " & Format$(TimeSerial(SysLastAccess.wHour, SysLastAccess.wMinute, SysLastAccess.wSecond), "hh:mm:ss") & vbCrLf
  2952.          strDisplay = strDisplay & "      Last Write : " & Format$(DateSerial(SysLastWrite.wYear, SysLastWrite.wMonth, SysLastWrite.wDay), "short date") & " " & Format$(TimeSerial(SysLastWrite.wHour, SysLastWrite.wMinute, SysLastWrite.wSecond), "hh:mm:ss") & vbCrLf & vbCrLf
  2953.       End If
  2954.    End If
  2955.    
  2956.    txt_Result = strDisplay
  2957.  
  2958.    'time the function
  2959.  
  2960.    TimerHandle = cTimerOpen()
  2961.    TimerStartOk = cTimerStart(TimerHandle)
  2962.    
  2963.    For i = 1 To Iteration
  2964.       intResult = cSetFileDateTime(File1, BckSysCreation, BckSysLastAccess, BckSysLastWrite)
  2965.    Next i
  2966.    
  2967.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2968.    
  2969.    TimerCloseOk = cTimerClose(TimerHandle)
  2970.  
  2971. End Sub
  2972.  
  2973. Private Sub TestFileMergeExt()
  2974.  
  2975.    Dim lResult           As Long
  2976.    Dim strResult           As String
  2977.    Dim strDisplay          As String
  2978.    
  2979.    Dim i                   As Long
  2980.    Dim TargetFile          As String
  2981.    
  2982.    strResult = ""
  2983.    strDisplay = ""
  2984.    
  2985.    ReDim FileArray(1 To 7) As String
  2986.  
  2987.    For i = 1 To 7
  2988.       FileArray(i) = Space$(256)
  2989.    Next i
  2990.    
  2991.    TargetFile = "autoexec.mergedext"
  2992.    
  2993.    strDisplay = strDisplay & "Prepare file array (code : " & cFilesInDirToArray("c:\*.*", A_ALL, FileArray()) & ")" & vbCrLf & vbCrLf
  2994.    
  2995.    strDisplay = strDisplay & "Merge the following 7 files : " & vbCrLf
  2996.    For i = 1 To 7
  2997.       FileArray(i) = "c:\" & FileArray(i)
  2998.       strDisplay = strDisplay & "   " & FileArray(i) & " (size : " & cFileSize(FileArray(i)) & ")" & vbCrLf
  2999.    Next i
  3000.    strDisplay = strDisplay & vbCrLf
  3001.    
  3002.    strDisplay = strDisplay & "Result is " & cFileMergeExt(FileArray(), TargetFile) & vbCrLf & vbCrLf
  3003.  
  3004.    txt_Result = strDisplay
  3005.  
  3006.    'time the function
  3007.  
  3008.    TimerHandle = cTimerOpen()
  3009.    TimerStartOk = cTimerStart(TimerHandle)
  3010.    
  3011.    For i = 1 To Iteration
  3012.       lResult = cFileMergeExt(FileArray(), TargetFile)
  3013.    Next i
  3014.    
  3015.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  3016.    
  3017.    TimerCloseOk = cTimerClose(TimerHandle)
  3018.  
  3019. End Sub
  3020.  
  3021. Private Sub TestGetFileTypeName()
  3022.  
  3023.    Dim intResult           As Integer
  3024.    Dim strResult           As String
  3025.    Dim strDisplay          As String
  3026.    Dim Tmp                 As String
  3027.    
  3028.    Dim i                   As Long
  3029.   
  3030.    strResult = ""
  3031.    strDisplay = ""
  3032.    
  3033.    ReDim FileArray(1 To 25) As String
  3034.  
  3035.    For i = 1 To 25
  3036.       FileArray(i) = Space$(256)
  3037.    Next i
  3038.    
  3039.    Tmp = cGetWindowsDirectory()
  3040.    
  3041.    intResult = cFilesInDirToArray(Tmp & "\*.*", A_ALL, FileArray())
  3042.    
  3043.    strDisplay = strDisplay & "Type Name of the 25 following files is : " & vbCrLf & vbCrLf
  3044.    
  3045.    For i = 1 To 25
  3046.       FileArray(i) = Tmp & "\" & FileArray(i)
  3047.       strDisplay = strDisplay & "   " & FileArray(i) & "   ->   " & cGetFileTypeName(FileArray(i)) & vbCrLf
  3048.    Next i
  3049.    strDisplay = strDisplay & vbCrLf
  3050.    
  3051.    txt_Result = strDisplay
  3052.  
  3053.    'time the function
  3054.  
  3055.    TimerHandle = cTimerOpen()
  3056.    TimerStartOk = cTimerStart(TimerHandle)
  3057.    
  3058.    For i = 1 To Iteration
  3059.       strResult = cGetFileTypeName(FileArray(1))
  3060.    Next i
  3061.    
  3062.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  3063.    
  3064.    TimerCloseOk = cTimerClose(TimerHandle)
  3065.  
  3066. End Sub
  3067. Private Sub TestShortCutFile()
  3068.  
  3069.    Dim intResult              As Integer
  3070.    Dim strResult              As String
  3071.    Dim strDisplay             As String
  3072.    Dim Tmp                    As String
  3073.    ReDim shortcutfile(1 To 2) As String
  3074.    Dim Description            As String
  3075.    
  3076.    Dim i                      As Long
  3077.    Dim j                      As Long
  3078.   
  3079.    strResult = ""
  3080.    strDisplay = ""
  3081.    
  3082.    Tmp = cGetWindowsDirectory()
  3083.       
  3084.    i = cSearchFile(Tmp, "*.lnk", T2WDirTest & "\search.log")
  3085.    
  3086.    If (i <= 0) Then
  3087.       strDisplay = "no ShortCut Files found in " & Tmp & " and sub-directories" & vbCrLf
  3088.    Else
  3089.    
  3090.       Close #1
  3091.       Open T2WDirTest & "\search.log" For Input Shared As #1
  3092.       Line Input #1, shortcutfile(1)
  3093.       Line Input #1, shortcutfile(2)
  3094.       Close #1
  3095.       
  3096.       For i = 1 To 2
  3097.       
  3098.          strDisplay = strDisplay & "ShortCut File is " & shortcutfile(i) & vbCrLf
  3099.          
  3100.          Description = cShortcutFileGetDescription(shortcutfile(i))
  3101.          
  3102.          strDisplay = strDisplay & "   Current Path : " & cShortcutFileGetPath(shortcutfile(i)) & vbCrLf
  3103.          strDisplay = strDisplay & "   Current Path83 : " & cShortcutFileGetPath83(shortcutfile(i)) & vbCrLf
  3104.          strDisplay = strDisplay & "   Current Work Dir : " & cShortcutFileGetWorkingDir(shortcutfile(i)) & vbCrLf
  3105.          strDisplay = strDisplay & "   Current Description : " & cShortcutFileGetDescription(shortcutfile(i)) & vbCrLf
  3106.          strDisplay = strDisplay & "   Current Arguments : " & cShortcutFileGetArguments(shortcutfile(i)) & vbCrLf & vbCrLf
  3107.          
  3108.          intResult = cShortcutFileSetDescription(shortcutfile(i), "this is a new description")
  3109.          strDisplay = strDisplay & "   Modify description to '" & cShortcutFileGetDescription(shortcutfile(i)) & "'" & vbCrLf
  3110.          strDisplay = strDisplay & "   Current Description : " & cShortcutFileGetDescription(shortcutfile(i)) & vbCrLf
  3111.          intResult = cShortcutFileSetDescription(shortcutfile(i), Description)
  3112.          strDisplay = strDisplay & "   Restore description to '" & cShortcutFileGetDescription(shortcutfile(i)) & "'" & vbCrLf
  3113.          strDisplay = strDisplay & "   Current Description : " & cShortcutFileGetDescription(shortcutfile(i)) & vbCrLf & vbCrLf
  3114.          
  3115.          strDisplay = strDisplay & "   get information by ID" & vbCrLf
  3116.          
  3117.          For j = SHORTCUTFILE_GETPATH To SHORTCUTFILE_GETARGUMENTS
  3118.             strDisplay = strDisplay & "      ID " & j & " : " & cShortcutFileGetInfo(shortcutfile(i), j) & vbCrLf
  3119.          Next j
  3120.       
  3121.          strDisplay = strDisplay & vbCrLf
  3122.          
  3123.       Next i
  3124.          
  3125.    End If
  3126.       
  3127.    txt_Result = strDisplay
  3128.  
  3129.    'time the function
  3130.  
  3131.    TimerHandle = cTimerOpen()
  3132.    TimerStartOk = cTimerStart(TimerHandle)
  3133.    
  3134.    For i = 1 To Iteration
  3135.       strResult = cShortcutFileGetInfo(shortcutfile(1), 1)
  3136.    Next i
  3137.    
  3138.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  3139.    
  3140.    TimerCloseOk = cTimerClose(TimerHandle)
  3141.  
  3142. End Sub
  3143.  
  3144. Private Sub TestGetFileDisplayName()
  3145.  
  3146.    Dim intResult           As Integer
  3147.    Dim strResult           As String
  3148.    Dim strDisplay          As String
  3149.    Dim Tmp                 As String
  3150.    
  3151.    Dim i                   As Long
  3152.   
  3153.    strResult = ""
  3154.    strDisplay = ""
  3155.    
  3156.    ReDim FileArray(1 To 25) As String
  3157.  
  3158.    For i = 1 To 25
  3159.       FileArray(i) = Space$(256)
  3160.    Next i
  3161.    
  3162.    Tmp = cGetWindowsDirectory()
  3163.    
  3164.    intResult = cFilesInDirToArray(Tmp & "\*.*", A_ALL, FileArray())
  3165.    
  3166.    strDisplay = strDisplay & "Display Name of the 25 following files is : " & vbCrLf & vbCrLf
  3167.    
  3168.    For i = 1 To 25
  3169.       FileArray(i) = Tmp & "\" & FileArray(i)
  3170.       strDisplay = strDisplay & "   " & FileArray(i) & "   ->   " & cGetFileDisplayName(FileArray(i)) & vbCrLf
  3171.    Next i
  3172.    strDisplay = strDisplay & vbCrLf
  3173.    
  3174.    txt_Result = strDisplay
  3175.  
  3176.    'time the function
  3177.  
  3178.    TimerHandle = cTimerOpen()
  3179.    TimerStartOk = cTimerStart(TimerHandle)
  3180.    
  3181.    For i = 1 To Iteration
  3182.       strResult = cGetFileTypeName(FileArray(1))
  3183.    Next i
  3184.    
  3185.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  3186.    
  3187.    TimerCloseOk = cTimerClose(TimerHandle)
  3188.  
  3189. End Sub
  3190.  
  3191. Private Sub TestFilesCopy()
  3192.  
  3193.    Dim lResult          As Long
  3194.    Dim strResult        As String
  3195.    Dim strDisplay       As String
  3196.    
  3197.    Dim i                As Long
  3198.    
  3199.    Dim SrcPath          As String
  3200.    Dim DstPath          As String
  3201.    Dim CopyPattern      As String
  3202.    Dim Flags            As Integer
  3203.   
  3204.    strResult = ""
  3205.    strDisplay = ""
  3206.    
  3207.    SrcPath = cGetWindowsDirectory()
  3208.    DstPath = T2WDirTest
  3209.    CopyPattern = "*.INI"
  3210.    
  3211.    'strDisplay = strDisplay & "Common option FC_FORCE_COPY" & vbCrLf & vbCrLf
  3212.    
  3213.    Flags = 0
  3214.    lResult = cFilesCopy(SrcPath, DstPath, CopyPattern, Flags)
  3215.    
  3216.    strDisplay = strDisplay & "Files Copy '" & CopyPattern & "'" & vbCrLf
  3217.    strDisplay = strDisplay & "   with no extra option" & vbCrLf
  3218.    strDisplay = strDisplay & "   from '" & SrcPath & "'" & vbCrLf
  3219.    strDisplay = strDisplay & "   to '" & DstPath & "'" & vbCrLf
  3220.    strDisplay = strDisplay & "   is " & lResult & vbCrLf & vbCrLf
  3221.    
  3222.    Flags = FC_OVERWRITE_EXISTING
  3223.    lResult = cFilesCopy(SrcPath, DstPath, CopyPattern, Flags)
  3224.    
  3225.    strDisplay = strDisplay & "Files Copy '" & CopyPattern & "'" & vbCrLf
  3226.    strDisplay = strDisplay & "   with option FC_OVERWRITE_EXISTING" & vbCrLf
  3227.    strDisplay = strDisplay & "   from '" & SrcPath & "'" & vbCrLf
  3228.    strDisplay = strDisplay & "   to '" & DstPath & "'" & vbCrLf
  3229.    strDisplay = strDisplay & "   is " & lResult & vbCrLf & vbCrLf
  3230.    
  3231.    Flags = FC_OVERWRITE_EXISTING Or FC_INCLUDE_SUB_DIRECTORY
  3232.    lResult = cFilesCopy(SrcPath, DstPath, CopyPattern, Flags)
  3233.    
  3234.    strDisplay = strDisplay & "Files Copy '" & CopyPattern & "'" & vbCrLf
  3235.    strDisplay = strDisplay & "   with option FC_OVERWRITE_EXISTING and FC_INCLUDE_SUB_DIRECTORY" & vbCrLf
  3236.    strDisplay = strDisplay & "   from '" & SrcPath & "'" & vbCrLf
  3237.    strDisplay = strDisplay & "   to '" & DstPath & "'" & vbCrLf
  3238.    strDisplay = strDisplay & "   is " & lResult & vbCrLf & vbCrLf
  3239.    
  3240.    Flags = FC_OVERWRITE_EXISTING Or FC_INCLUDE_SUB_DIRECTORY Or FC_DONT_COPY_EMPTY_DIRECTORY
  3241.    lResult = cFilesCopy(SrcPath, DstPath, CopyPattern, Flags)
  3242.    
  3243.    strDisplay = strDisplay & "Files Copy '" & CopyPattern & "'" & vbCrLf
  3244.    strDisplay = strDisplay & "   with option FC_OVERWRITE_EXISTING and FC_INCLUDE_SUB_DIRECTORY and FC_DONT_COPY_EMPTY_DIRECTORY" & vbCrLf
  3245.    strDisplay = strDisplay & "   from '" & SrcPath & "'" & vbCrLf
  3246.    strDisplay = strDisplay & "   to '" & DstPath & "'" & vbCrLf
  3247.    strDisplay = strDisplay & "   is " & lResult & vbCrLf & vbCrLf
  3248.    
  3249.    Flags = 0
  3250.    
  3251.    txt_Result = strDisplay
  3252.  
  3253.    'time the function
  3254.  
  3255.    TimerHandle = cTimerOpen()
  3256.    TimerStartOk = cTimerStart(TimerHandle)
  3257.    
  3258.    For i = 1 To Iteration
  3259.       lResult = cFilesCopy(SrcPath, DstPath, CopyPattern, Flags)
  3260.    Next i
  3261.    
  3262.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  3263.    
  3264.    TimerCloseOk = cTimerClose(TimerHandle)
  3265.  
  3266. End Sub
  3267.  
  3268. Private Sub TestFilesCopyExt()
  3269.  
  3270.    Dim lResult          As Long
  3271.    Dim strResult        As String
  3272.    Dim strDisplay       As String
  3273.    
  3274.    Dim i                As Long
  3275.    
  3276.    Dim SrcPath          As String
  3277.    Dim DstPath          As String
  3278.    Dim CopyPattern      As String
  3279.    Dim Flags            As Integer
  3280.   
  3281.    strResult = ""
  3282.    strDisplay = ""
  3283.    
  3284.    SrcPath = cGetWindowsDirectory()
  3285.    DstPath = T2WDirTest
  3286.    CopyPattern = "*.ini"
  3287.    
  3288.    Flags = FC_DISPLAY_2_LINES
  3289.    lResult = cFilesCopyExt(lblProgress, SrcPath, DstPath, CopyPattern, Flags)
  3290.    
  3291.    strDisplay = strDisplay & "Files Copy Ext '" & CopyPattern & "'" & vbCrLf
  3292.    strDisplay = strDisplay & "   with no option" & vbCrLf
  3293.    strDisplay = strDisplay & "   from '" & SrcPath & "'" & vbCrLf
  3294.    strDisplay = strDisplay & "   to '" & DstPath & "'" & vbCrLf
  3295.    strDisplay = strDisplay & "   is " & lResult & vbCrLf & vbCrLf
  3296.    
  3297.    Flags = FC_OVERWRITE_EXISTING Or FC_DISPLAY_2_LINES
  3298.    lResult = cFilesCopyExt(lblProgress, SrcPath, DstPath, CopyPattern, Flags)
  3299.    
  3300.    strDisplay = strDisplay & "Files Copy Ext '" & CopyPattern & "'" & vbCrLf
  3301.    strDisplay = strDisplay & "   with option FC_OVERWRITE_EXISTING" & vbCrLf
  3302.    strDisplay = strDisplay & "   from '" & SrcPath & "'" & vbCrLf
  3303.    strDisplay = strDisplay & "   to '" & DstPath & "'" & vbCrLf
  3304.    strDisplay = strDisplay & "   is " & lResult & vbCrLf & vbCrLf
  3305.    
  3306.    Flags = FC_OVERWRITE_EXISTING Or FC_INCLUDE_SUB_DIRECTORY Or FC_DISPLAY_2_LINES
  3307.    lResult = cFilesCopyExt(lblProgress, SrcPath, DstPath, CopyPattern, Flags)
  3308.    
  3309.    strDisplay = strDisplay & "Files Copy Ext '" & CopyPattern & "'" & vbCrLf
  3310.    strDisplay = strDisplay & "   with option FC_OVERWRITE_EXISTING and FC_INCLUDE_SUB_DIRECTORY" & vbCrLf
  3311.    strDisplay = strDisplay & "   from '" & SrcPath & "'" & vbCrLf
  3312.    strDisplay = strDisplay & "   to '" & DstPath & "'" & vbCrLf
  3313.    strDisplay = strDisplay & "   is " & lResult & vbCrLf & vbCrLf
  3314.    
  3315.    Flags = 0
  3316.    
  3317.    txt_Result = strDisplay
  3318.  
  3319.    'time the function
  3320.  
  3321.    TimerHandle = cTimerOpen()
  3322.    TimerStartOk = cTimerStart(TimerHandle)
  3323.    
  3324.    For i = 1 To Iteration
  3325.       lResult = cFilesCopyExt(lblProgress, SrcPath, DstPath, CopyPattern, Flags)
  3326.    Next i
  3327.    
  3328.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  3329.    
  3330.    TimerCloseOk = cTimerClose(TimerHandle)
  3331.  
  3332. End Sub
  3333.