home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32534.ZIP / _FILE.FRM < prev    next >
Text File  |  1998-05-02  |  140KB  |  3,945 lines

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