home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
tool
/
various
/
t2w012
/
time2win.frm
< prev
next >
Wrap
Text File
|
1995-02-27
|
158KB
|
5,460 lines
VERSION 2.00
Begin Form Form1
BackColor = &H00C0C0C0&
Caption = "Time To WIN (Demo)"
ClientHeight = 7845
ClientLeft = 930
ClientTop = 765
ClientWidth = 9105
Height = 8370
Left = 870
LinkTopic = "Form1"
ScaleHeight = 7845
ScaleWidth = 9105
Top = 300
Width = 9225
Begin PictureBox Picture1
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 480
Left = 8550
Picture = TIME2WIN.FRX:0000
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 10
Top = 180
Visible = 0 'False
Width = 480
End
Begin ComboBox Combo2
Height = 300
Left = 6570
TabIndex = 2
Top = 450
Width = 1185
End
Begin TextBox Text1
Height = 285
Left = 3150
TabIndex = 8
Text = "Text1"
Top = 7470
Width = 5865
End
Begin Frame Frame1
BackColor = &H00C0C0C0&
Height = 1455
Left = 90
TabIndex = 6
Top = 5940
Visible = 0 'False
Width = 8925
Begin ListBox List2
Height = 1200
Left = 4590
TabIndex = 5
Top = 180
Width = 4155
End
Begin ListBox List1
Height = 1200
Left = 180
TabIndex = 4
Top = 180
Width = 4155
End
End
Begin CommandButton Command1
Caption = "&Start demo for the selected item"
Height = 285
Left = 90
TabIndex = 0
Top = 450
Width = 4065
End
Begin ComboBox Combo1
Height = 300
Left = 90
TabIndex = 9
Text = "0"
Top = 90
Width = 7665
End
Begin Label Label2
BackStyle = 0 'Transparent
Caption = "&Text for string manipulation"
Height = 195
Left = 90
TabIndex = 7
Top = 7500
Width = 2985
End
Begin Label Label1
BackStyle = 0 'Transparent
Caption = "&Iterations for speed test"
Height = 195
Left = 4320
TabIndex = 1
Top = 510
Width = 2175
End
Begin Label Label3
BackStyle = 0 'Transparent
BorderStyle = 1 'Fixed Single
Height = 5055
Left = 90
TabIndex = 3
Top = 810
Width = 8925
WordWrap = -1 'True
End
End
Option Explicit
Option Base 1
Dim Item As Integer
Dim ItemFile As Integer
Dim ItemMean As Integer
Const RandI = 32767
Const RandL = 2147483647
Const RandS = 1E+10!
Const RandD = 1E+16
Sub Combo2_Click ()
Item = Val(Combo2.Text)
ItemFile = Val(Combo2.Text)
ItemMean = Val(Combo2.Text)
End Sub
Sub Command1_Click ()
Static Flag As Integer
If (Flag = True) Then Exit Sub
Form1.Tag = cGetIn(cEXEnameActiveWindow(), ".", 1)
cDisableFI Picture1
Flag = True
MousePointer = 11
Frame1.Visible = False
List1.Clear
List2.Clear
Label3.Caption = ""
DoEvents
Select Case Combo1.ListIndex
Case 0
Frame1.Visible = True
Call TestAddI
Case 1
Frame1.Visible = True
Call TestDeviationI
Case 2
Frame1.Visible = True
Call TestFillI
Case 3
Frame1.Visible = True
Call TestMaxI
Case 4
Frame1.Visible = True
Call TestMeanI
Case 5
Frame1.Visible = True
Call TestMinI
Case 6
Frame1.Visible = True
Call TestSetI
Case 7
Frame1.Visible = True
Call TestSumI
Case 8
Frame1.Visible = True
Call TestSortI
Case 9
Frame1.Visible = True
Call TestReverseSortI
Case 10
Call TestAddTime
Case 11
Call TestTimeBetween
Case 12
Call TestCheckTime
Case 13
Call TestHourTo
Case 14
Call TestWindowsIni
Case 15
Call TestWinINI1
Case 16
Call TestWinINI2
Case 17
Call TestWinINI3
Case 18
Call TestAllSubDir
Case 19
Call TestGetDriveCurrentDir
Case 20
Call TestGetDefaultCurrentDir
Case 21
Call TestChDir
Case 22
Call TestCountFiles
Case 23
Call TestCountDirectories
Case 24
Call TestKillFiles
Case 25
Call TestGetFullnameInEnv
Case 26
Call TestGetDiskSpace
Case 27
Call TestGetDiskUsed
Case 28
Call TestGetDiskFree
Case 29
Call TestKillDir
Case 30
Call TestRenameFile
Case 31
Call TestFileResetAllAttrib
Case 32
Call TestFileSetAllAttrib
Case 33
Call TestIsFileX
Case 34
Call TestSubDirectory
Case 35
Call TestUniqueFileName
Case 36
Call TestIsX
Case 37
Call TestOneCharFromLeft
Case 38
Call TestOneCharFromRight
Case 39
Call TestBlockCharFromLeft
Case 40
Call TestBlockCharFromRight
Case 41
Call TestCompact
Case 42
Call TestUncompact
Case 43
Call TestInsertChars
Case 44
Call TestRemoveBlockChar
Case 45
Call TestRemoveOneChar
Case 46
Call TestCompressTab
Case 47
Call TestExpandTab
Case 48
Call TestGiveBitPalindrome
Case 49
Call TestIsBitPalindrome
Case 50
Call TestInsertBlocksBy
Case 51
Call TestInsertBlocks
Case 52
Call TestResizeStringAndFill
Case 53
Call TestResizeString
Case 54
Call TestFilterBlocks
Case 55
Call TestFilterChars
Case 56
Call TestCheckChars
Case 57
Call TestChangeChars
Case 58
Call TestChangeCharsUntil
Case 59
Call TestReverse
Case 60
Call TestGetIn
Case 61
Call TestGetBlock
Case 62
Call TestCreateAndFill
Case 63
Call TestStringCRC32
Case 64
Call TestCompress
Case 65
Call TestEncrypt
Case 66
Call TestDecrypt
Case 67
Call TestFileCRC32
Case 68
Call TestLrc
Case 69
Call TestIsPalindrome
Case 70
Call TestCheckNumericity
Case 71
Call TestFill
Case 72
Call TestSetAllBits
Case 73
Call TestSetBit
Case 74
Call TestGetBit
Case 75
Call TestFindBitSet
Case 76
Call TestFindBitReset
Case 77
Call TestToggleBit
Case 78
Call TestToggleAllBits
Case 79
Call TestReverseAllBits
Case 80
Call TestReverseAllBitsByChar
Case 81
Call TestCreateBits
Case 82
Call TestAtoR
Case 83
Call TestRtoA
Case 84
Call TestCustomControls
Case 85
Call TestSwap
Case 86
Call TestMin
Case 87
Call TestMenuChange
Case 88
Call TestFilesSize
Case 89
Call TestClusterSize
Case 90
Call TestAscTime
Case 91
Call TestLanguage
Case 92
Call TestReadLanguage
Case 93
Call TestFileCmp
Case 94
Call TestFileCopy
Case 95
Call TestFileFilter
Case 96
Call TestFileFilterNot
Case 97
Call TestFileEncrypt
Case 98
Call TestFileCompressTab
Case 99
Call TestSplitPath
Case 100
Call TestFullPath
Case 101
Call TestMakePath
Case 102
Call TestMsgBox
Case 103
Call TestInpBox
Case 104
Call TestMixChars
Case 105
Call TestFileVersionInfo
Case 106
Call TestFileVersion
Case 107
Call TestFileLineCount
Case 108
Call TestFileToX
Case 109
Call TestBig
Case 110
Call TestBigNum
Case 111
Call TestSysMenuChange(LNG_FRENCH)
Case 112
Call TestSysMenuChange(LNG_GERMAN)
Case 113
Call TestSysMenuChange(LNG_ITALIAN)
Case 114
Call TestSysMenuChange(LNG_ENGLISH)
Case 115
Call TestFileMerge
Case 116
Call TestFileSR
Case 117
Call TestFileS
Case 118
Call TestPatternMatch
Case 119
Call TestPatternExtMatch
Case 120
Call TestMorse
Case 121
Call TestDriveType
Case 122
Call TestBaseConversion
Case 123
Call TestFileStatictics
Case 124
Call TestDAStr(True)
Case 125
Call TestDAL(True)
Case 126
Call TestDAType(True)
Case 127
Call TestDAStr(False)
Case 128
Call TestDAL(False)
Case 129
Call TestDAType(False)
Case 130
Call TestDAStr(1)
Case 131
Call TestDAL(1)
Case 132
Call TestDAType(1)
End Select
MousePointer = 0
Flag = False
cEnableFI Picture1
End Sub
Sub CreateFile ()
Dim j As Integer
j = cFileResetAllAttrib("TEST.DAT")
Close #1
Open "TEST.DAT" For Output As #1
Print #1, "This is a file test for time2win.dll"
Close #1
j = cFileResetAllAttrib("TEST.DAT")
End Sub
Sub DefCnv ()
Dim i As Integer
Dim Tmp As String
Close #1
Open "c:\tmp\tmp.Tmp" For Input Shared As #1
Close #2
Open "c:\tmp\tmp1.Tmp" For Output Shared As #2
While Not EOF(1)
Line Input #1, Tmp
i = i + 1
Tmp = cCompress(Tmp)
Print #2, Tab(10); cGetIn(Tmp, "@", 1);
Print #2, Tab(60); "@" & i
Wend
Close #1
Close #2
End Sub
Sub Form_Load ()
Combo2.AddItem "5"
Combo2.AddItem "10"
Combo2.AddItem "50"
Combo2.AddItem "100"
Combo2.AddItem "500"
Combo2.AddItem "1000"
Combo2.AddItem "5000"
Combo1.AddItem "Array routines : Add"
Combo1.AddItem "Array routines : Deviation"
Combo1.AddItem "Array routines : Fill"
Combo1.AddItem "Array routines : Max"
Combo1.AddItem "Array routines : Mean"
Combo1.AddItem "Array routines : Min"
Combo1.AddItem "Array routines : Set"
Combo1.AddItem "Array routines : Sum"
Combo1.AddItem "Array routines : Sort"
Combo1.AddItem "Array routines : ReverseSort"
Combo1.AddItem "Time routines : AddTime"
Combo1.AddItem "Time routines : TimeBetween"
Combo1.AddItem "Time routines : CheckTime"
Combo1.AddItem "Time routines : HourTo"
Combo1.AddItem "WIN.INI routines : some separators"
Combo1.AddItem "WIN.INI routines : devices"
Combo1.AddItem "WIN.INI routines : printerports"
Combo1.AddItem "WIN.INI routines : winsection (windows section)"
Combo1.AddItem "Files routines : AllSubDirectories"
Combo1.AddItem "Files routines : GetDriveCurrentDir"
Combo1.AddItem "Files routines : GetDefaultCurrentDir"
Combo1.AddItem "Files routines : ChDir"
Combo1.AddItem "Files routines : CountFiles"
Combo1.AddItem "Files routines : CountDirectories"
Combo1.AddItem "Files routines : KillFiles"
Combo1.AddItem "Files routines : GetFullnameInEnv"
Combo1.AddItem "Files routines : GetDiskSpace"
Combo1.AddItem "Files routines : GetDiskUsed"
Combo1.AddItem "Files routines : GetDiskFree"
Combo1.AddItem "Files routines : KillDir"
Combo1.AddItem "Files routines : RenameFile"
Combo1.AddItem "Files routines : FileResetAllAttrib"
Combo1.AddItem "Files routines : FileSetAllAttrib"
Combo1.AddItem "Files routines : IsFileX"
Combo1.AddItem "Files routines : SubDirectory"
Combo1.AddItem "Files routines : UniqueFileName"
Combo1.AddItem "String routines : IsX"
Combo1.AddItem "String routines : OneCharFromLeft"
Combo1.AddItem "String routines : OneCharFromRight"
Combo1.AddItem "String routines : BlockCharFromLeft"
Combo1.AddItem "String routines : BlockCharFromRight"
Combo1.AddItem "String routines : Compact"
Combo1.AddItem "String routines : Uncompact"
Combo1.AddItem "String routines : InsertChars"
Combo1.AddItem "String routines : RemoveBlockChar"
Combo1.AddItem "String routines : RemoveOneChar"
Combo1.AddItem "String routines : CompressTab"
Combo1.AddItem "String routines : ExpandTab"
Combo1.AddItem "String routines : GiveBitPalindrome"
Combo1.AddItem "String routines : IsBitPalindrome"
Combo1.AddItem "String routines : InsertBlocksBy"
Combo1.AddItem "String routines : InsertBlocks"
Combo1.AddItem "String routines : ResizeStringAndFill"
Combo1.AddItem "String routines : ResizeString"
Combo1.AddItem "String routines : FilterBlocks"
Combo1.AddItem "String routines : FilterChars"
Combo1.AddItem "String routines : CheckChars"
Combo1.AddItem "String routines : ChangeChars"
Combo1.AddItem "String routines : ChangeCharsUntil"
Combo1.AddItem "String routines : Reverse"
Combo1.AddItem "String routines : GetIn"
Combo1.AddItem "String routines : GetBlock"
Combo1.AddItem "String routines : CreateAndFill"
Combo1.AddItem "String routines : StringCRC32"
Combo1.AddItem "String routines : Compress"
Combo1.AddItem "String routines : Encrypt"
Combo1.AddItem "String routines : Decrypt"
Combo1.AddItem "Files routines : FileCRC32"
Combo1.AddItem "String routines : Lrc"
Combo1.AddItem "String routines : IsPalindrome"
Combo1.AddItem "String routines : CheckNumericity"
Combo1.AddItem "String routines : Fill"
Combo1.AddItem "String routines : SetAllBits"
Combo1.AddItem "String routines : SetBit"
Combo1.AddItem "String routines : GetBit"
Combo1.AddItem "String routines : FindBitSet"
Combo1.AddItem "String routines : FindBitReset"
Combo1.AddItem "String routines : ToggleBit"
Combo1.AddItem "String routines : ToggleAllBits"
Combo1.AddItem "String routines : ReverseAllBits"
Combo1.AddItem "String routines : ReverseAllBitsByChar"
Combo1.AddItem "String routines : CreateBits"
Combo1.AddItem "String routines : ArabicToRoman"
Combo1.AddItem "String routines : RomanToArabic"
Combo1.AddItem "Custom controls"
Combo1.AddItem "Swap routines"
Combo1.AddItem "Min,Max routines"
Combo1.AddItem "System menu change : French"
Combo1.AddItem "Files routines : FilesSize, FilesSizeOnDisk, FilesSlack"
Combo1.AddItem "Files routines : GetClusterSize"
Combo1.AddItem "Language routines : GetAscTime"
Combo1.AddItem "Language routines : Days and months name"
Combo1.AddItem "Language routines : Read Control Language"
Combo1.AddItem "File routines : Compare"
Combo1.AddItem "File routines : File Copy"
Combo1.AddItem "File routines : File Filter"
Combo1.AddItem "File routines : File Filter Not"
Combo1.AddItem "File routines : File Encrypt/Decrypt"
Combo1.AddItem "File routines : File Compress/Expand Tab"
Combo1.AddItem "File routines : SplitPath"
Combo1.AddItem "File routines : FullPath"
Combo1.AddItem "File routines : MakePath"
Combo1.AddItem "Language routines : Multi-Language & TimeOut Message Box"
Combo1.AddItem "Language routines : Multi-Language Input Box"
Combo1.AddItem "String routines : MixChars"
Combo1.AddItem "Windows Specific Routines : FileVersionInfo"
Combo1.AddItem "Windows Specific Routines : FileVersion"
Combo1.AddItem "File routines : FileLineCount"
Combo1.AddItem "File routines : FileToLower/FileToUpper"
Combo1.AddItem "Misc. routines : Big Double"
Combo1.AddItem "Misc. routines : Big Numbers"
Combo1.AddItem "System menu change (one call) : French"
Combo1.AddItem "System menu change (one call) : German"
Combo1.AddItem "System menu change (one call) : Italian"
Combo1.AddItem "System menu change (one call) : English"
Combo1.AddItem "File routines : FileMerge"
Combo1.AddItem "File routines : FileSearchAndReplace"
Combo1.AddItem "File routines : FileSearch, FileSearchCount"
Combo1.AddItem "String routines : PatternMatch"
Combo1.AddItem "String routines : PatternExtMatch"
Combo1.AddItem "Misc. routines : Morse"
Combo1.AddItem "DOS routines : GetDriveType"
Combo1.AddItem "Misc. routines : Base conversion"
Combo1.AddItem "File routines : FileStatistics"
Combo1.AddItem "Disk Array routines : (create) String"
Combo1.AddItem "Disk Array routines : (create) Long"
Combo1.AddItem "Disk Array routines : (create) Type'd (b.e. : tagTASKENTRY)"
Combo1.AddItem "Disk Array routines : (use) String"
Combo1.AddItem "Disk Array routines : (use) Long"
Combo1.AddItem "Disk Array routines : (use) Type'd (b.e. : tagTASKENTRY)"
Combo1.AddItem "Disk Array routines : (clear) String"
Combo1.AddItem "Disk Array routines : (clear) Long"
Combo1.AddItem "Disk Array routines : (clear) Type'd (b.e. : tagTASKENTRY)"
Combo1.ListIndex = Combo1.ListCount - 1
Combo2.ListIndex = 1
Item = Val(Combo2.Text)
ItemFile = Val(Combo2.Text)
ItemMean = Val(Combo2.Text)
Text1.Text = "A/BC/DEF/GHIJ"
End Sub
Sub Label2_DblClick ()
Dim i As Integer
Dim n As Integer
n = Combo1.ListCount - 1
For i = 0 To n
Combo1.ListIndex = i
DoEvents
Call Command1_Click
DoEvents
Next i
End Sub
Sub TestAddI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
ReDim array(ItemMean) As Integer
Randomize Timer
For i = LBound(array) To UBound(array)
array(i) = 0
List1.AddItem "" & array(i)
Next i
j = cAddI(array(), 10)
For i = LBound(array) To UBound(array)
List2.AddItem "" & array(i)
Next i
Tmp1 = Tmp1 & "Add 10 to element 1 of an integer array is : " & array(1) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Add 10 to element " & ItemMean & " of an integer array is : " & array(ItemMean) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cAddI(array(), 1)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestAddTime ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "The time 10:00 + 02:01 is " & cIntoHour(cAddTime(600 + 121)) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "The time 23:58 + 01:02 is " & cIntoHour(cAddTime(1438 + 62)) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cAddTime(1439 + 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestAllSubDir ()
Dim n As Integer
Dim Tmp As String
n = -1
Tmp = cAllSubDirectories("C:", n)
Label3.Caption = "Directories founden on drive C are " & n & Chr$(13) & Tmp
End Sub
Sub TestAscTime ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = LNG_FRENCH To LNG_SPANISH
Tmp1 = Tmp1 + cGetAscTime(i) & Chr$(13)
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cGetAscTime(LNG_FRENCH)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestAtoR ()
Dim Tmp As Integer
Dim Tmp1 As String
Tmp = Year(Int(Now))
Tmp1 = Tmp & " in Roman is " & UCase$(cArabicToRoman(Tmp)) & Chr$(13)
Tmp = Year(Int(Now)) - 1
Tmp1 = Tmp1 & Tmp & " in Roman is " & UCase$(cArabicToRoman(Tmp)) & Chr$(13)
Tmp = Year(Int(Now)) + 1
Tmp1 = Tmp1 & Tmp & " in Roman is " & UCase$(cArabicToRoman(Tmp)) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestBaseConversion ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = 2 To 20
Tmp1 = Tmp1 + "Convert '1234567' base 10 to base " & i & " is " & cBaseConversion("1234567", 10, i) & Chr$(13)
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cBaseConversion("123456789", 10, 10)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestBetween ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "601 is not between 720 and 840 => " & cBetween(601, 720, 840) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "601 is between 540 and 602 => " & cBetween(601, 540, 602) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "61 is between 61 and 62 => " & cBetween(61, 61, 62) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cBetween(720, 0, 1439)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestBig ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Integer
Dim m1 As Double
Dim m2 As Double
m1 = 123456789012345#
m2 = 987654321098765#
Tmp1 = Tmp1 & "Double : Add '" & m1 & "' and '" & m2 & "' is '" & (m1 + m2) & "'" & Chr$(13)
Tmp1 = Tmp1 & "Big Double : Add '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigAdd(cMKN(Str$(m1)), cMKN(Str$(m2))), 0) & "'" & Chr$(13)
Tmp1 = Tmp1 & "Big Num : Add '" & m1 & "' and '" & m2 & "' is '" & cBigNum(LTrim$(Str$(m1)), BIG_ADD, LTrim$(Str$(m2))) & "'" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Double : Sub '" & m1 & "' and '" & m2 & "' is '" & (m1 - m2) & "'" & Chr$(13)
Tmp1 = Tmp1 & "Big Double : Sub '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigSub(cMKN(Str$(m1)), cMKN(Str$(m2))), 0) & "'" & Chr$(13)
Tmp1 = Tmp1 & "Big Num : Sub '" & m1 & "' and '" & m2 & "' is '" & cBigNum(LTrim$(Str$(m1)), BIG_SUB, LTrim$(Str$(m2))) & "'" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Double : Mul '" & m1 & "' and '" & m2 & "' is '" & (m1 * m2) & "'" & Chr$(13)
Tmp1 = Tmp1 & "Big Double : Mul '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigMul(cMKN(Str$(m1)), cMKN(Str$(m2))), 0) & "'" & Chr$(13)
Tmp1 = Tmp1 & "Big Num : Mul '" & m1 & "' and '" & m2 & "' is '" & cBigNum(LTrim$(Str$(m1)), BIG_MUL, LTrim$(Str$(m2))) & "'" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Double : Div '" & m1 & "' and '" & m2 & "' is '" & (m1 / m2) & "'" & Chr$(13)
Tmp1 = Tmp1 & "Big Double : Div '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigDiv(cMKN(Str$(m1)), cMKN(Str$(m2))), 0) & "'" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp3 = cBigAdd(cMKN(Str$(m1)), cMKN(Str$(m2)))
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestBigNum ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim Tmp4 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
Tmp3 = "00001234567890123456789012345678901"
Tmp4 = "00009876543210987654321098765432100"
Tmp1 = Tmp1 & "X = " & Tmp3 & Chr$(13)
Tmp1 = Tmp1 & "Y = " & Tmp4 & Chr$(13) & Chr$(13)
Tmp = Tmp3
Tmp2 = Tmp4
Tmp1 = Tmp1 & "'(X) + (Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_ADD, Tmp2) & "'" & Chr$(13)
Tmp = Tmp3
Tmp2 = "-" & Tmp4
Tmp1 = Tmp1 & "'(X) + (-Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_ADD, Tmp2) & "'" & Chr$(13)
Tmp = "-" & Tmp3
Tmp2 = Tmp4
Tmp1 = Tmp1 & "'(-X) + (Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_ADD, Tmp2) & "'" & Chr$(13)
Tmp = "-" & Tmp3
Tmp2 = "-" & Tmp4
Tmp1 = Tmp1 & "'(-X) + (-Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_ADD, Tmp2) & "'" & Chr$(13) & Chr$(13)
Tmp = Tmp3
Tmp2 = Tmp4
Tmp1 = Tmp1 & "'(X) - (Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_SUB, Tmp2) & "'" & Chr$(13)
Tmp = Tmp3
Tmp2 = "-" & Tmp4
Tmp1 = Tmp1 & "'(X) - (-Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_SUB, Tmp2) & "'" & Chr$(13)
Tmp = "-" & Tmp3
Tmp2 = Tmp4
Tmp1 = Tmp1 & "'(-X) - (Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_SUB, Tmp2) & "'" & Chr$(13)
Tmp = "-" & Tmp3
Tmp2 = "-" & Tmp4
Tmp1 = Tmp1 & "'(-X) - (-Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_SUB, Tmp2) & "'" & Chr$(13) & Chr$(13)
Tmp = Tmp3
Tmp2 = Tmp4
Tmp1 = Tmp1 & "'(X) * (Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_MUL, Tmp2) & "'" & Chr$(13)
Tmp = Tmp3
Tmp2 = "-" & Tmp4
Tmp1 = Tmp1 & "'(X) * (-Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_MUL, Tmp2) & "'" & Chr$(13)
Tmp = "-" & Tmp3
Tmp2 = Tmp4
Tmp1 = Tmp1 & "'(-X) * (Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_MUL, Tmp2) & "'" & Chr$(13)
Tmp = "-" & Tmp3
Tmp2 = "-" & Tmp4
Tmp1 = Tmp1 & "'(-X) * (-Y)' " & Space$(3) & " is '" & cBigNum(Tmp, BIG_MUL, Tmp2) & "'" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp3 = cBigNum(Tmp, BIG_ADD, Tmp2)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " ADD = " & (cReadBasisTimer() / 1000) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp3 = cBigNum(Tmp, BIG_SUB, Tmp2)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " SUB = " & (cReadBasisTimer() / 1000) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp3 = cBigNum(Tmp, BIG_MUL, Tmp2)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " MUL = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestBlockCharFromLeft ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "The 3,7,1 blocks from left of [" & Tmp & "] are " & Chr$(13) & Chr$(13)
Tmp = Text1.Text
Tmp1 = title & "3:" & cBlockCharFromLeft(Tmp, 3) & " | 7:" & cBlockCharFromLeft(Tmp, 7) & " | 1:" & cBlockCharFromLeft(Tmp, 1) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cBlockCharFromLeft(Tmp, 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestBlockCharFromRight ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "The 3,7,1 blocks from right of [" & Tmp & "] are " & Chr$(13) & Chr$(13)
Tmp = Text1.Text
Tmp1 = title & "3:" & cBlockCharFromRight(Tmp, 3) & " | 7:" & cBlockCharFromRight(Tmp, 7) & " | 1:" & cBlockCharFromRight(Tmp, 1) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cBlockCharFromRight(Tmp, 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestChangeChars ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
title = "Change 'AZM' into 'qyc' of [" & Tmp & "] is "
Call cChangeChars(Tmp, "AZM", "qyc")
Tmp1 = title & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cChangeChars(Tmp, "AZM", "qyc")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestChangeCharsUntil ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
title = "Change 'AZM' into 'qyc' of [" & Tmp & "] until 'N' is "
Call cChangeCharsUntil(Tmp, "AZM", "qyc", "N")
Tmp1 = title & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cChangeCharsUntil(Tmp, "AZM", "qyc", "N")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestChDir ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = 1 To 26
k = cChDir(Chr$(64 + i) & ":\")
If (k = True) Then
Tmp1 = Tmp1 & "ChDir to \ on '" & Chr$(64 + i) & ":' is " & IIf(k = True, "succesfull", "not successfull") & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cChDir("C:\")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestChDrive ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = 1 To 26
k = cChDrive(Chr$(64 + i))
If (k = True) Then
Tmp1 = Tmp1 & "ChDrive on '" & Chr$(64 + i) & ":' is " & IIf(k = True, "succesfull", "not successfull") & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cChDrive("C")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCheckChars ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
title = "Check 'A','Z' in [" & Tmp & "] is "
Tmp1 = title & IIf(cCheckChars(Tmp, "AZ"), "all present", "not all present") & Chr$(13) & Chr$(13)
title = Tmp1 & "Check 'a','Z' in [" & Tmp & "] is "
Tmp1 = title & IIf(cCheckChars(Tmp, "aZ"), "all present", "not all present") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cCheckChars(Tmp, "AZ")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCheckNumericity ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "[" & Tmp & "] is "
Tmp1 = title & IIf(cCheckNumericity(Tmp), "Numeric", " not Numeric") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cCheckNumericity(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCheckTime ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "10:01 is not between 12:00 and 14:00 => " & cCheckTime(601, 720, 840) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "10:01 is between 09:00 and 10:02 => " & cCheckTime(601, 540, 602) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "01:01 is between 23:58 and 02:45 => " & cCheckTime(61, 1438, 165) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cCheckTime(720, 0, 1439)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestClusterSize ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = 1 To 26
k = cGetDiskClusterSize(Chr$(64 + i))
If (k <> True) Then
Tmp1 = Tmp1 & "DiskClusterSize for '" & Chr$(64 + i) & ":' is " & k & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cGetDiskClusterSize("C")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCompact ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "30313233343536373839"
title = "Compact '" & Tmp & "' is "
Tmp1 = title & cCompact(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cCompact(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCompress ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "A " & Chr$(9) & "BC "
Tmp = Tmp1
title = "Filter chr(0),chr(9),chr(32) in [" & Tmp & "] is "
Tmp1 = title & cCompress(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cCompress(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCompressTab ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "A BC DEF GHIJ "
title = "Compress tab (3 chars) into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = title & cCompressTab(Tmp, 3) & Chr$(13) & Chr$(13)
Tmp = "A BC DEF GHIJ "
title = "Compress tab (2 chars) into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & cCompressTab(Tmp, 2) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cCompressTab(Tmp, 3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCountDirectories ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
Tmp1 = ""
Tmp1 = Tmp1 & "Number of directories in C:\ is " & cCountDirectories("C:\*.*") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Number of directories in D:\ is " & cCountDirectories("D:\*.*") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Number of directories in E:\ is " & cCountDirectories("E:\*.*") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To 10
k = cCountDirectories("C:\*.*")
Next i
Tmp1 = Tmp1 & "speed for " & 10 & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCountFiles ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Integer
Tmp1 = ""
Tmp1 = Tmp1 & "Number of files in C:\ is " & cCountFiles("C:\*.*") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Number of files in D:\ is " & cCountFiles("D:\*.*") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Number of files in E:\ is " & cCountFiles("E:\*.*") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To 10
k = cCountFiles("C:\*.*")
Next i
Tmp1 = Tmp1 & "speed for " & 10 & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCreateAndFill ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Create and Fill a string of 40 chars with [" & Tmp & "] is "
Tmp1 = title & cCreateAndFill(40, Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cCreateAndFill(40, Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCreateBits ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Create a string for 1024 bits is "
Tmp1 = title & Len(cCreateBits(1024)) & " bytes" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cCreateBits(1024)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestCustomControls ()
Dim i As Integer
Dim n As Integer
Dim Tmp1 As String
n = Form1.Count - 1
For i = 0 To n
Tmp1 = Tmp1 + "Control name is '" & cGetCtlNameIndex(Form1.Controls(i)) & "' Control Class is '" & cGetCtlClass(Form1.Controls(i)) & "'" + Chr$(13)
Next i
Label3.Caption = Tmp1
End Sub
Sub TestDAL (CreateOrUse As Integer)
Dim Tmp As String
Dim ErrCode As Integer
Dim DA As tagDISKARRAY
ErrCode = cMakeDir("c:\t2w_tmp")
DA.nFilename = "c:\t2w_tmp\dalong.tmp"
DA.nType = DA_LONG
DA.nRows = 100
DA.nCols = 100
DA.nSheets = 2
If (CreateOrUse <> 1) Then
ErrCode = cDACreate(DA, CreateOrUse)
Else
ErrCode = cDACreate(DA, False)
ErrCode = cDAClear(DA)
End If
Tmp = Tmp & "ErrCode = " & ErrCode & Chr$(13) & Chr$(13)
If (ErrCode = True) Then
Tmp = Tmp & "DA.daSize = " & DA.daSize & Chr$(13)
Tmp = Tmp & "DA.Signature = " & DA.Signature & Chr$(13)
Tmp = Tmp & "DA.nFilename = " & Trim$(DA.nFilename) & Chr$(13)
Tmp = Tmp & "DA.nType = " & DA.nType & Chr$(13)
Tmp = Tmp & "DA.nRows = " & DA.nRows & Chr$(13)
Tmp = Tmp & "DA.nCols = " & DA.nCols & Chr$(13)
Tmp = Tmp & "DA.nSheets = " & DA.nSheets & Chr$(13)
Tmp = Tmp & "DA.rHandle = " & DA.rHandle & Chr$(13)
Tmp = Tmp & "DA.rElementSize = " & DA.rElementSize & Chr$(13)
Tmp = Tmp & "DA.rFileSize = " & DA.rFileSize & Chr$(13)
Tmp = Tmp & "DA.rParts = " & DA.rParts & Chr$(13)
Tmp = Tmp & "DA.rRemain = " & DA.rRemain & Chr$(13)
Tmp = Tmp & "DA.rSheetSize = " & DA.rSheetSize & Chr$(13)
Tmp = Tmp & "DA.rTime = " & DA.rTime & Chr$(13) & Chr$(13)
If (CreateOrUse = True) Then
Call cDAPut(DA, 1, 1, 1, 12345)
Call cDAPut(DA, 1, DA.nCols, 1, 56789)
Call cDAPut(DA, DA.nRows, 1, 1, 54321)
Call cDAPut(DA, DA.nRows, DA.nCols, 1, 98765)
Call cDAPut(DA, 1, 1, 2, 12345678)
Call cDAPut(DA, 1, DA.nCols, 2, 34567890)
Call cDAPut(DA, DA.nRows, 1, 2, 123456789)
Call cDAPut(DA, DA.nRows, DA.nCols, 2, 987654321)
End If
Tmp = Tmp & "R:1 , C:1 , D:1, Value : " & cDAGet(DA, 1, 1, 1) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:1, Value : " & cDAGet(DA, 1, DA.nCols, 1) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:" & DA.nRows & ", C:1 , D:1, Value : " & cDAGet(DA, DA.nRows, 1, 1) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:1, Value : " & cDAGet(DA, DA.nRows, DA.nCols, 1) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:1 , D:2, Value : " & cDAGet(DA, 1, 1, 2) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:2, Value : " & cDAGet(DA, 1, DA.nCols, 2) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:" & DA.nRows & ", C:1 , D:2, Value : " & cDAGet(DA, DA.nRows, 1, 2) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:2, Value : " & cDAGet(DA, DA.nRows, DA.nCols, 2) & " , time : " & DA.rTime & Chr$(13)
End If
Call cDAClose(DA, False)
Label3.Caption = Tmp
End Sub
Sub TestDAStr (CreateOrUse)
Dim Tmp As String
Dim ErrCode As Integer
Dim DA As tagDISKARRAY
ErrCode = cMakeDir("c:\t2w_tmp")
DA.nFilename = "c:\t2w_tmp\dastring.tmp"
DA.nType = 50
DA.nRows = 100
DA.nCols = 100
DA.nSheets = 2
If (CreateOrUse <> 1) Then
ErrCode = cDACreate(DA, CreateOrUse)
Else
ErrCode = cDACreate(DA, False)
ErrCode = cDAClear(DA)
End If
Tmp = Tmp & "ErrCode = " & ErrCode & Chr$(13) & Chr$(13)
If (ErrCode = True) Then
Tmp = Tmp & "DA.daSize = " & DA.daSize & Chr$(13)
Tmp = Tmp & "DA.Signature = " & DA.Signature & Chr$(13)
Tmp = Tmp & "DA.nFilename = " & Trim$(DA.nFilename) & Chr$(13)
Tmp = Tmp & "DA.nType = " & DA.nType & Chr$(13)
Tmp = Tmp & "DA.nRows = " & DA.nRows & Chr$(13)
Tmp = Tmp & "DA.nCols = " & DA.nCols & Chr$(13)
Tmp = Tmp & "DA.nSheets = " & DA.nSheets & Chr$(13)
Tmp = Tmp & "DA.rHandle = " & DA.rHandle & Chr$(13)
Tmp = Tmp & "DA.rElementSize = " & DA.rElementSize & Chr$(13)
Tmp = Tmp & "DA.rFileSize = " & DA.rFileSize & Chr$(13)
Tmp = Tmp & "DA.rParts = " & DA.rParts & Chr$(13)
Tmp = Tmp & "DA.rRemain = " & DA.rRemain & Chr$(13)
Tmp = Tmp & "DA.rSheetSize = " & DA.rSheetSize & Chr$(13)
Tmp = Tmp & "DA.rTime = " & DA.rTime & Chr$(13) & Chr$(13)
If (CreateOrUse = True) Then
Call cDAPut(DA, 1, 1, 1, "D:1, ABCDEFGHIJ")
Call cDAPut(DA, 1, DA.nCols, 1, "D:1, abcdefghij")
Call cDAPut(DA, DA.nRows, 1, 1, "D:1, OPQRSTUVWXYZ")
Call cDAPut(DA, DA.nRows, DA.nCols, 1, "D:1, oprqstuvwxyz")
Call cDAPut(DA, 1, 1, 2, "D:2, 1234567890")
Call cDAPut(DA, 1, DA.nCols, 2, "D:2, 0987654321")
Call cDAPut(DA, DA.nRows, 1, 2, "D:2, 12345ABCDE")
Call cDAPut(DA, DA.nRows, DA.nCols, 2, "D:2, VWXYZ54321")
End If
Tmp = Tmp & "R:1 , C:1 , D:1, Value : " & Trim$(cDAGet(DA, 1, 1, 1)) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:1, Value : " & Trim$(cDAGet(DA, 1, DA.nCols, 1)) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:" & DA.nRows & ", C:1 , D:1, Value : " & Trim$(cDAGet(DA, DA.nRows, 1, 1)) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:1, Value : " & Trim$(cDAGet(DA, DA.nRows, DA.nCols, 1)) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:1 , D:2, Value : " & Trim$(cDAGet(DA, 1, 1, 2)) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:2, Value : " & Trim$(cDAGet(DA, 1, DA.nCols, 2)) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:" & DA.nRows & ", C:1 , D:2, Value : " & Trim$(cDAGet(DA, DA.nRows, 1, 2)) & " , time : " & DA.rTime & Chr$(13)
Tmp = Tmp & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:2, Value : " & Trim$(cDAGet(DA, DA.nRows, DA.nCols, 2)) & " , time : " & DA.rTime & Chr$(13)
End If
Call cDAClose(DA, False)
Label3.Caption = Tmp
End Sub
Sub TestDAType (CreateOrUse As Integer)
Dim Tmp As String
Dim ErrCode As Integer
Dim DA As tagDISKARRAY
Dim TE As tagTASKENTRY
ErrCode = cMakeDir("c:\t2w_tmp")
DA.nFilename = "c:\t2w_tmp\datype.tmp"
DA.nType = Len(TE)
DA.nRows = 100
DA.nCols = 100
DA.nSheets = 2
If (CreateOrUse <> 1) Then
ErrCode = cDACreate(DA, CreateOrUse)
Else
ErrCode = cDACreate(DA, False)
ErrCode = cDAClear(DA)
End If
Tmp = Tmp & "ErrCode = " & ErrCode & Chr$(13) & Chr$(13)
If (ErrCode = True) Then
Tmp = Tmp & "DA.daSize = " & DA.daSize & Chr$(13)
Tmp = Tmp & "DA.Signature = " & DA.Signature & Chr$(13)
Tmp = Tmp & "DA.nFilename = " & Trim$(DA.nFilename) & Chr$(13)
Tmp = Tmp & "DA.nType = " & DA.nType & Chr$(13)
Tmp = Tmp & "DA.nRows = " & DA.nRows & Chr$(13)
Tmp = Tmp & "DA.nCols = " & DA.nCols & Chr$(13)
Tmp = Tmp & "DA.nSheets = " & DA.nSheets & Chr$(13)
Tmp = Tmp & "DA.rHandle = " & DA.rHandle & Chr$(13)
Tmp = Tmp & "DA.rElementSize = " & DA.rElementSize & Chr$(13)
Tmp = Tmp & "DA.rFileSize = " & DA.rFileSize & Chr$(13)
Tmp = Tmp & "DA.rParts = " & DA.rParts & Chr$(13)
Tmp = Tmp & "DA.rRemain = " & DA.rRemain & Chr$(13)
Tmp = Tmp & "DA.rSheetSize = " & DA.rSheetSize & Chr$(13)
Tmp = Tmp & "DA.rTime = " & DA.rTime & Chr$(13) & Chr$(13)
If (CreateOrUse = True) Then
ErrCode = cTasks(TE, True)
Call cDAPutType(DA, 1, 1, 1, TE)
ErrCode = cTasks(TE, False)
Call cDAPutType(DA, 1, DA.nCols, 1, TE)
ErrCode = cTasks(TE, False)
Call cDAPutType(DA, DA.nRows, 1, 1, TE)
ErrCode = cTasks(TE, False)
Call cDAPutType(DA, DA.nRows, DA.nCols, 1, TE)
ErrCode = cTasks(TE, False)
Call cDAPutType(DA, 1, 1, 2, TE)
ErrCode = cTasks(TE, False)
Call cDAPutType(DA, 1, DA.nCols, 2, TE)
ErrCode = cTasks(TE, False)
Call cDAPutType(DA, DA.nRows, 1, 2, TE)
ErrCode = cTasks(TE, False)
Call cDAPutType(DA, DA.nRows, DA.nCols, 2, TE)
End If
Call cDAGetType(DA, 1, 1, 1, TE)
Tmp = Tmp & "R:1 , C:1 , D:1, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
Call cDAGetType(DA, 1, DA.nCols, 1, TE)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:1, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
Call cDAGetType(DA, DA.nRows, 1, 1, TE)
Tmp = Tmp & "R:" & DA.nRows & ", C:1 , D:1, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
Call cDAGetType(DA, DA.nRows, DA.nCols, 1, TE)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:1, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
Call cDAGetType(DA, 1, 1, 2, TE)
Tmp = Tmp & "R:1 , C:1 , D:2, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
Call cDAGetType(DA, 1, DA.nCols, 2, TE)
Tmp = Tmp & "R:1 , C:" & DA.nCols & ", D:2, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
Call cDAGetType(DA, DA.nRows, 1, 2, TE)
Tmp = Tmp & "R:" & DA.nRows & ", C:1 , D:2, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
Call cDAGetType(DA, DA.nRows, DA.nCols, 2, TE)
Tmp = Tmp & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:2, TE.szModule : " & cCompress(TE.szModule) & " , time : " & DA.rTime & Chr$(13)
End If
Call cDAClose(DA, False)
Label3.Caption = Tmp
End Sub
Sub TestDecrypt ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Integer
Tmp3 = cToHexa(Format$(76543210))
Tmp2 = "TIME TO WIN"
For i = ENCRYPT_LEVEL_0 To ENCRYPT_LEVEL_3
Tmp = cEncrypt(Tmp2, Tmp3, i)
Tmp1 = Tmp1 & "Decrypt (level " & i & ") of [" & Tmp & "] with '?' is "
Tmp1 = Tmp1 & "[" & cDecrypt(Tmp, Tmp3, i) & "]" & Chr$(13) & Chr$(13)
Next i
cStartBasisTimer
For i = 1 To Item
Tmp2 = cDecrypt(Tmp2, Tmp1, ENCRYPT_LEVEL_3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestDeviationI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
Dim n As Double
ReDim array(ItemMean) As Integer
Randomize Timer
m = 0
For i = LBound(array) To UBound(array)
array(i) = Int(RandI * Rnd(1))
m = m + array(i)
List1.AddItem "" & array(i)
Next i
m = m / (UBound(array) - LBound(array) + 1)
n = 0
For i = LBound(array) To UBound(array)
n = n + ((array(i) - m) * (array(i) - m))
Next i
n = (Sqr(n) / (UBound(array) - LBound(array) + 1))
Tmp1 = "The Deviation of a integer array of " & (ItemMean + 1) & " elements is " & Chr$(13) & Chr$(13) & cDeviationI(array()) & " (" & n & ")" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
m = cDeviationI(array())
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestDriveType ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = ""
For i = 1 To 26
j = cGetDriveType(Chr$(64 + i))
If (j > 0) Then
Tmp1 = Tmp1 & "'" & Chr$(64 + i) & ":' is "
Select Case j
Case 2
Tmp1 = Tmp1 & "removable disk" & Chr$(13)
Case 3
Tmp1 = Tmp1 & "fixed disk" & Chr$(13)
Case 4
Tmp1 = Tmp1 & "remote disk" & Chr$(13)
Case 20
Tmp1 = Tmp1 & "cd-rom" & Chr$(13)
End Select
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cGetDriveType("C")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestEncrypt ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Integer
Tmp3 = cToHexa(Format$(76543210))
Tmp2 = "TIME TO WIN"
Tmp = Text1.Text
For i = ENCRYPT_LEVEL_0 To ENCRYPT_LEVEL_3
Tmp1 = Tmp1 & "Encrypt (level " & i & ") of [" & Tmp2 & "] with '?' is "
Tmp1 = Tmp1 & "[" & cEncrypt(Tmp2, Tmp3, i) & "]" & Chr$(13) & Chr$(13)
Next i
cStartBasisTimer
For i = 1 To Item
Tmp2 = cEncrypt(Tmp2, Tmp1, ENCRYPT_LEVEL_3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestExpandTab ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "A" & Chr$(9) & "BC" & Chr$(9) & "DEF" & Chr$(9) & "GHIJ" & Chr$(9) & ""
title = "Expand tab (2 chars) into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = title & cExpandTab(Tmp, 2) & Chr$(13) & Chr$(13)
Tmp = "A" & Chr$(9) & "BC" & Chr$(9) & "DEF" & Chr$(9) & "GHIJ" & Chr$(9) & ""
title = "Expand tab (4 chars) into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & cExpandTab(Tmp, 4) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cExpandTab(Tmp, 3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileCmp ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\tmp\autoexec.bat"
Tmp1 = Tmp1 & "Compare file attribute " & Tmp & " with " & Tmp2 & " is " & cCmpFileAttribute(Tmp, Tmp2) & Chr$(13)
Tmp1 = Tmp1 & "Compare file size " & Tmp & " with " & Tmp2 & " is " & cCmpFileSize(Tmp, Tmp2) & Chr$(13)
Tmp1 = Tmp1 & "Compare file time " & Tmp & " with " & Tmp2 & " is " & cCmpFileTime(Tmp, Tmp2) & Chr$(13)
Tmp1 = Tmp1 & "Compare file contents (case sensitive) " & Tmp & " with " & Tmp2 & " is " & cCmpFileContents(Tmp, Tmp2, True) & Chr$(13)
Tmp1 = Tmp1 & "Compare file contents (not sensitive) " & Tmp & " with " & Tmp2 & " is " & cCmpFileContents(Tmp, Tmp2, False) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cCmpFileSize(Tmp, Tmp2)
Next i
Tmp1 = Tmp1 & "file size speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cCmpFileContents(Tmp, Tmp2, True)
Next i
Tmp1 = Tmp1 & "file contents (cs) speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cCmpFileContents(Tmp, Tmp2, False)
Next i
Tmp1 = Tmp1 & "file contents (ns) speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileCompressTab ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\autoexec.tb1"
Tmp3 = "c:\autoexec.tb2"
For i = 1 To 4
Tmp1 = Tmp1 & "File CompressTab (" & i & " spaces = 1 tab) " & Tmp & " to " & Tmp2 & " is " & cFileCompressTab(Tmp, Tmp2, i) & Chr$(13)
Tmp1 = Tmp1 & "File ExpandTab (" & i & " spaces = 1 tab) " & Tmp2 & " to " & Tmp3 & " is " & cFileExpandTab(Tmp2, Tmp3, i) & Chr$(13)
Tmp1 = Tmp1 & "Compare file contents (not sensitive) '" & Tmp & "' with '" & Tmp3 & "' is " & IIf(cCmpFileContents(Tmp, Tmp3, False) = -1, "same", "not same") & Chr$(13) & Chr$(13)
Next i
cStartBasisTimer
For i = 1 To Item
j = cFileCompressTab(Tmp, Tmp2, 3)
Next i
j = cFileExpandTab(Tmp2, Tmp3, 3)
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileCopy ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\autoexec.tab"
Tmp1 = Tmp1 & "File Copy " & Tmp & " to " & Tmp2 & " is " & cFileCopy(Tmp, Tmp2) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileCopy(Tmp, Tmp2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileCRC32 ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Tmp = "c:\config.sys"
title = "CRC32 for file '" & Tmp & "' is "
Tmp1 = Tmp1 & title & Hex$(cFileCRC32(Tmp, OPEN_MODE_BINARY)) & Chr$(13) & Chr$(13)
Tmp = "c:\autoexec.bat"
title = "CRC32 for file '" & Tmp & "' is "
Tmp1 = Tmp1 & title & Hex$(cFileCRC32(Tmp, OPEN_MODE_BINARY)) & Chr$(13) & Chr$(13)
Tmp = "c:\command.com"
title = "CRC32 for file '" & Tmp & "' is "
Tmp1 = Tmp1 & title & Hex$(cFileCRC32(Tmp, OPEN_MODE_BINARY)) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
k = cFileCRC32(Tmp, OPEN_MODE_BINARY)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileEncrypt ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim Tmp4 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\autoexec.tb1"
Tmp3 = "c:\autoexec.tb2"
Tmp4 = cToHexa(Format$(76543210))
For i = ENCRYPT_LEVEL_0 To ENCRYPT_LEVEL_3
Tmp1 = Tmp1 & "File Encrypt (level " & i & ") '" & Tmp & "' with '?' to '" & Tmp2 & "' is " & cFileEncrypt(Tmp, Tmp2, Tmp4, i) & Chr$(13)
Tmp1 = Tmp1 & "File Decrypt (level " & i & ") '" & Tmp2 & "' with '?' to '" & Tmp3 & "' is " & cFileDecrypt(Tmp2, Tmp3, Tmp4, i) & Chr$(13)
Tmp1 = Tmp1 & "Compare file contents (not sensitive) '" & Tmp & "' with '" & Tmp3 & "' is " & IIf(cCmpFileContents(Tmp, Tmp3, False) = -1, "same", "not same") & Chr$(13) & Chr$(13)
Next i
cStartBasisTimer
For i = 1 To Item
j = cFileEncrypt(Tmp, Tmp2, Tmp4, ENCRYPT_LEVEL_3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileFilter ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\autoexec.tab"
Tmp3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Tmp3 = Tmp3 + LCase$(Tmp)
Tmp1 = Tmp1 & "File Filter (A-Z, a-z) " & Tmp & " to " & Tmp2 & " is " & cFileFilter(Tmp, Tmp2, Tmp3) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileFilter(Tmp, Tmp2, Tmp3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileFilterNot ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\autoexec.tab"
Tmp3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Tmp3 = Tmp3 + LCase$(Tmp) + " =" + Chr$(13) + Chr$(10)
Tmp1 = Tmp1 & "File Filter Not in (A-Z, a-z, CR, LF, SPACE, =) " & Tmp & " to " & Tmp2 & " is " & cFileFilterNot(Tmp, Tmp2, Tmp3) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileFilterNot(Tmp, Tmp2, Tmp3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileGetAttrib ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = cFilesInDirectory("*.*", True)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
Tmp = cSubDirectory("*.*", True)
Tmp = cSubDirectory("*.*", False)
Tmp = cSubDirectory("*.*", False)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileGetAttrib(Tmp, FileAttrib)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileLineCount ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "C:\AUTOEXEC.BAT"
Tmp1 = Tmp1 & "Total lines in '" & Tmp & "' are " & cFileLineCount(Tmp) & Chr$(13) & Chr$(13)
Tmp = "C:\CONFIG.SYS"
Tmp1 = Tmp1 & "Total lines in '" & Tmp & "' are " & cFileLineCount(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileLineCount(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileMerge ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\config.sys"
Tmp3 = "c:\merge.byt"
Tmp1 = Tmp1 & "File Merge '" & Tmp & "' and '" & Tmp2 & "' to '" & Tmp3 & "' is " & cFileMerge(Tmp, Tmp2, Tmp3) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileMerge(Tmp, Tmp2, Tmp3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFilePathExists ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "File time2win.dll " & IIf(cFilePathExists("time2win.dll") = True, "found", "not found") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Path \windows " & IIf(cFilePathExists("\windows") = True, "found", "not found") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Path \windows\wintime " & IIf(cFilePathExists("\windows\wintime") = True, "found", "not found") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFilePathExists("time2win.dll")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileResetAllAttrib ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
FileAttrib.Archive = False
FileAttrib.Hidden = True
FileAttrib.ReadOnly = True
FileAttrib.System = True
j = cFileResetAllAttrib(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been reset with" & Chr$(13)
Tmp1 = Tmp1 & " flag archive" & Chr$(13)
Tmp1 = Tmp1 & " flag hidden" & Chr$(13)
Tmp1 = Tmp1 & " flag read-only" & Chr$(13)
Tmp1 = Tmp1 & " flag system" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileResetAllAttrib(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileResetArchive ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim nArchive As Integer
Dim nHidden As Integer
Dim nReadOnly As Integer
Dim nSubDir As Integer
Dim nSystem As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetAllAttrib(Tmp)
j = cFileResetArchive(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been reset with" & Chr$(13)
Tmp1 = Tmp1 & " flag archive" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileResetArchive(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileResetHidden ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim nArchive As Integer
Dim nHidden As Integer
Dim nReadOnly As Integer
Dim nSubDir As Integer
Dim nSystem As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetAllAttrib(Tmp)
j = cFileResetHidden(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been reset with" & Chr$(13)
Tmp1 = Tmp1 & " flag hidden" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileResetHidden(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileResetReadOnly ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Dim nArchive As Integer
Dim nHidden As Integer
Dim nReadOnly As Integer
Dim nSubDir As Integer
Dim nSystem As Integer
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetAllAttrib(Tmp)
j = cFileResetReadOnly(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been reset with" & Chr$(13)
Tmp1 = Tmp1 & " flag read-only" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileResetReadOnly(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileResetSystem ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetAllAttrib(Tmp)
j = cFileResetSystem(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been reset with" & Chr$(13)
Tmp1 = Tmp1 & " flag system" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileResetSystem(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileS ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim Tmp4 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp3 = "re"
Tmp4 = "SET"
Tmp1 = Tmp1 & "File Search (insensitive) : '" & Tmp3 & "' in '" & Tmp & "' is " & cFileSearch(Tmp, Tmp3, False) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search and Count (insensitive) : '" & Tmp3 & "' in '" & Tmp & "' is " & cFileSearchCount(Tmp, Tmp3, False) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search (insensitive) : '" & Tmp4 & "' in '" & Tmp & "' is " & cFileSearch(Tmp, Tmp4, False) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search and Count (insensitive) : '" & Tmp4 & "' in '" & Tmp & "' is " & cFileSearchCount(Tmp, Tmp4, False) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search (sensitive) : '" & Tmp3 & "' in '" & Tmp & "' is " & cFileSearch(Tmp, Tmp3, True) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search and Count (sensitive) : '" & Tmp3 & "' in '" & Tmp & "' is " & cFileSearchCount(Tmp, Tmp3, True) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search (sensitive) : '" & Tmp4 & "' in '" & Tmp & "' is " & cFileSearch(Tmp, Tmp4, True) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search and Count (sensitive) : '" & Tmp4 & "' in '" & Tmp & "' is " & cFileSearchCount(Tmp, Tmp4, True) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
If ((i Mod 2) = 1) Then
j = cFileSearch(Tmp, Tmp3, False)
Else
j = cFileSearchCount(Tmp, Tmp3, False)
End If
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileSetAllAttrib ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetAllAttrib(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been set with" & Chr$(13)
Tmp1 = Tmp1 & " flag archive" & Chr$(13)
Tmp1 = Tmp1 & " flag hidden" & Chr$(13)
Tmp1 = Tmp1 & " flag read-only" & Chr$(13)
Tmp1 = Tmp1 & " flag system" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileSetAllAttrib(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileSetArchive ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetArchive(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been set with" & Chr$(13)
Tmp1 = Tmp1 & " flag archive" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileSetArchive(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileSetAttrib ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
FileAttrib.Archive = False
FileAttrib.Hidden = True
FileAttrib.ReadOnly = True
FileAttrib.System = True
j = cFileSetAttrib(Tmp, FileAttrib)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been set with" & Chr$(13)
Tmp1 = Tmp1 & " flag hidden" & Chr$(13)
Tmp1 = Tmp1 & " flag read-only" & Chr$(13)
Tmp1 = Tmp1 & " flag system" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileSetAttrib(Tmp, FileAttrib)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileSetHidden ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetHidden(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been set with" & Chr$(13)
Tmp1 = Tmp1 & " flag hidden" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileSetHidden(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileSetReadOnly ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetReadOnly(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been set with" & Chr$(13)
Tmp1 = Tmp1 & " flag read-only" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileSetReadOnly(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileSetSystem ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim FileAttrib As FileAttributeType
Tmp1 = ""
Tmp = "TEST.DAT"
Call CreateFile
j = cFileSetSystem(Tmp)
j = cFileGetAttrib(Tmp, FileAttrib)
Tmp1 = "File " & Tmp & " has been set with" & Chr$(13)
Tmp1 = Tmp1 & " flag system" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & Chr$(13)
Tmp1 = Tmp1 & "File " & Tmp & IIf(FileAttrib.System, " is System", " is not System") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFileSetSystem(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFilesInDirectory ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
title = "The 10 first files in this directory are" & Chr$(13) & Chr$(13)
Tmp1 = title
Tmp2 = cFilesInDirectory("*.*", True)
For i = 1 To 10
Tmp1 = Tmp1 & Tmp2 & Chr$(13)
Tmp2 = cFilesInDirectory("*.*", False)
Next i
Tmp1 = Tmp1 & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cFilesInDirectory("*.*", True)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileSize ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Tmp1 = "File size for time2win.dll is " & cFileSize("time2win.dll") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File size for Path \windows " & cFileSize("\windows") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File size for Path \windows\wintime " & cFileSize("\windows\wintime") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cFileSize("time2win.dll")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileSR ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim Tmp4 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\autoexec.tab"
Tmp3 = "REM"
Tmp4 = "rem REMARK"
Tmp1 = Tmp1 & "File Copy " & Tmp & " to " & Tmp2 & " is " & cFileCopy(Tmp, Tmp2) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search-Replace (insensitive) : '" & Tmp3 & "' -> '" & Tmp4 & "' in '" & Tmp2 & "' is " & cFileSearchAndReplace(Tmp2, Tmp3, Tmp4, "c:\tmp.tmp", False) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File Search-Replace (sensitive) : '" & Tmp4 & "' -> '" & Tmp3 & "' in '" & Tmp2 & "' is " & cFileSearchAndReplace(Tmp2, Tmp4, Tmp3, "c:\tmp.tmp", True) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Compare file contents (insensitive) " & Tmp2 & " with " & Tmp & " is " & IIf(cCmpFileContents(Tmp2, Tmp, False) = True, "same", "not same") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
If ((i Mod 2) = 1) Then
j = cFileSearchAndReplace(Tmp2, Tmp3, Tmp4, "", True)
Else
j = cFileSearchAndReplace(Tmp2, Tmp4, Tmp3, "", True)
End If
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFilesSize ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim Size1 As Long
Dim Size2 As Long
Tmp1 = ""
Tmp1 = Tmp1 & "Size of files c:\*.* is " & cFilesSize("c:\*.*") & Chr$(13)
Tmp1 = Tmp1 & "Size of files c:\*.bat is " & cFilesSize("c:\*.bat") & Chr$(13)
Tmp1 = Tmp1 & "Size of files c:\*.sys is " & cFilesSize("c:\*.sys") & Chr$(13)
Tmp1 = Tmp1 & "Size of files c:\*.com is " & cFilesSize("c:\*.com") & Chr$(13)
Tmp1 = Tmp1 & Chr$(13)
Tmp1 = Tmp1 & "Size of files c:\*.* on disk is " & cFilesSizeOnDisk("c:\*.*") & Chr$(13)
Tmp1 = Tmp1 & "Size of files c:\*.bat on disk is " & cFilesSizeOnDisk("c:\*.bat") & Chr$(13)
Tmp1 = Tmp1 & "Size of files c:\*.sys on disk is " & cFilesSizeOnDisk("c:\*.sys") & Chr$(13)
Tmp1 = Tmp1 & "Size of files c:\*.com on disk is " & cFilesSizeOnDisk("c:\*.com") & Chr$(13)
Tmp1 = Tmp1 & Chr$(13)
Tmp1 = Tmp1 & "Slack of files c:\*.* on disk is " & cFilesSlack("c:\*.*", Size1, Size2) & " %" & Chr$(13)
Tmp1 = Tmp1 & "Slack of files c:\*.bat on disk is " & cFilesSlack("c:\*.bat", Size1, Size2) & " %" & Chr$(13)
Tmp1 = Tmp1 & "Slack of files c:\*.sys on disk is " & cFilesSlack("c:\*.sys", Size1, Size2) & " %" & Chr$(13)
Tmp1 = Tmp1 & "Slack of files c:\*.com on disk is " & cFilesSlack("c:\*.com", Size1, Size2) & " %" & Chr$(13)
cStartBasisTimer
For i = 1 To 10
k = cFilesSize("c:\*.*")
Next i
Tmp1 = Tmp1 & "speed for " & 10 & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileStatictics ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim Tmp4 As String
Dim i As Integer
Dim j As Long
Dim nL As Long
Dim nW As Long
Dim nC As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp1 = Tmp1 & "File statictics for '" & Tmp & "' is " & cFileStatistics(Tmp, nL, nW, nC) & Chr$(13)
Tmp1 = Tmp1 & "number of lines : " & nL & Chr$(13)
Tmp1 = Tmp1 & "number of words : " & nW & Chr$(13)
Tmp1 = Tmp1 & "number of chars : " & nC & Chr$(13) & Chr$(13)
Tmp = "c:\config.sys"
Tmp1 = Tmp1 & "File statictics for '" & Tmp & "' is " & cFileStatistics(Tmp, nL, nW, nC) & Chr$(13)
Tmp1 = Tmp1 & "number of lines : " & nL & Chr$(13)
Tmp1 = Tmp1 & "number of words : " & nW & Chr$(13)
Tmp1 = Tmp1 & "number of chars : " & nC & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileStatistics(Tmp, nL, nW, nC)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileStatistic ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Tmp1 = "File drive for time2win.dll is " & cFileDrive("time2win.dll") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File last time modified for time2win.dll is " & cFileLastTimeModified("time2win.dll") & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File last date modified for time2win.dll is " & cFileLastDateModified("time2win.dll") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp = cFileDrive("time2win.dll")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileToX ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "c:\autoexec.bat"
Tmp2 = "c:\autoexec.lwr"
Tmp3 = "c:\autoexec.upr"
Tmp1 = Tmp1 & "File to lower '" & Tmp & "' to '" & Tmp2 & "' is " & cFileToLower(Tmp, Tmp2) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "File to upper '" & Tmp & "' to '" & Tmp3 & "' is " & cFileToUpper(Tmp, Tmp3) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cFileToLower(Tmp, Tmp2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestFileVersion ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim Status As Integer
Tmp = cGetSystemDirectory() & "\krnl386.exe"
Tmp1 = Tmp1 & "File Version for '" & Tmp & "' is " & Chr$(13)
For i = VER_VERSION_PRODUCT To VER_PRODUCT_VERSION
Tmp1 = Tmp1 & " " & i & " = " & cGetFileVersion(Tmp, i) & Chr$(13)
Next i
Tmp = cGetSystemDirectory() & "\time2win.dll"
Tmp1 = Tmp1 & "File Version for '" & Tmp & "' is " & Chr$(13)
For i = VER_VERSION_PRODUCT To VER_PRODUCT_VERSION
Tmp1 = Tmp1 & " " & i & " = " & cGetFileVersion(Tmp, i) & Chr$(13)
Next i
cStartBasisTimer
For i = 1 To ItemFile
Tmp = cGetFileVersion(Tmp, -1)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFileVersionInfo ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim Status As Integer
Dim FILEVERSIONINFO As tagFILEVERSIONINFO
Tmp = cGetSystemDirectory() & "\krnl386.exe"
Tmp1 = Tmp1 & "File Version Information for '" & Tmp & "' is " & Chr$(13)
Status = cGetFileVersionInfo(Tmp, FILEVERSIONINFO)
Tmp1 = Tmp1 & " VersionProduct = " & FILEVERSIONINFO.VersionProduct & Chr$(13)
Tmp1 = Tmp1 & " FileDescription = " & FILEVERSIONINFO.FileDescription & Chr$(13)
Tmp1 = Tmp1 & " FileVersion = " & FILEVERSIONINFO.FileVersion & Chr$(13)
Tmp1 = Tmp1 & " InternalName = " & FILEVERSIONINFO.InternalName & Chr$(13)
Tmp1 = Tmp1 & " LegalCopyright = " & FILEVERSIONINFO.LegalCopyright & Chr$(13)
Tmp1 = Tmp1 & " LegalTrademarks = " & FILEVERSIONINFO.LegalTrademarks & Chr$(13)
Tmp1 = Tmp1 & " Comments = " & FILEVERSIONINFO.Comments & Chr$(13)
Tmp1 = Tmp1 & " ProductName = " & FILEVERSIONINFO.ProductName & Chr$(13)
Tmp1 = Tmp1 & " ProductVersion = " & FILEVERSIONINFO.ProductVersion & Chr$(13) & Chr$(13)
Tmp = cGetSystemDirectory() & "\time2win.dll"
Tmp1 = Tmp1 & "File Version Information for '" & Tmp & "' is " & Chr$(13)
Status = cGetFileVersionInfo(Tmp, FILEVERSIONINFO)
Tmp1 = Tmp1 & " VersionProduct = " & FILEVERSIONINFO.VersionProduct & Chr$(13)
Tmp1 = Tmp1 & " FileDescription = " & FILEVERSIONINFO.FileDescription & Chr$(13)
Tmp1 = Tmp1 & " FileVersion = " & FILEVERSIONINFO.FileVersion & Chr$(13)
Tmp1 = Tmp1 & " InternalName = " & FILEVERSIONINFO.InternalName & Chr$(13)
Tmp1 = Tmp1 & " LegalCopyright = " & FILEVERSIONINFO.LegalCopyright & Chr$(13)
Tmp1 = Tmp1 & " LegalTrademarks = " & FILEVERSIONINFO.LegalTrademarks & Chr$(13)
Tmp1 = Tmp1 & " Comments = " & FILEVERSIONINFO.Comments & Chr$(13)
Tmp1 = Tmp1 & " ProductName = " & FILEVERSIONINFO.ProductName & Chr$(13)
Tmp1 = Tmp1 & " ProductVersion = " & FILEVERSIONINFO.ProductVersion & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Status = cGetFileVersionInfo(Tmp, FILEVERSIONINFO)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFill ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Fill of [" & Tmp & "] with [*=] is "
Call cFill(Tmp, "*=")
Tmp1 = title & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cFill(Tmp, "=*")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFillI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
ReDim array(ItemMean) As Integer
Randomize Timer
For i = LBound(array) To UBound(array)
array(i) = 0
List1.AddItem "" & array(i)
Next i
j = cFillI(array(), 1)
For i = LBound(array) To UBound(array)
List2.AddItem "" & array(i)
Next i
Tmp1 = Tmp1 & "Fill 1 to element 1 of an integer array is : " & array(1) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Fill 1 to element " & ItemMean & " of an integer array is : " & array(ItemMean) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFillI(array(), 1)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFilterBlocks ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Filter blocks between '/' and '/' in [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = title & cFilterBlocks(Tmp, "//") & Chr$(13) & Chr$(13)
title = "Filter blocks between 'B' and 'I' in [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & cFilterBlocks(Tmp, "BI") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cFilterBlocks(Tmp, "//")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFilterChars ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Filter 'B','/' in [" & Tmp & "] is "
Tmp1 = title & cFilterChars(Tmp, "B/") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cFilterChars(Tmp, "B/")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFindBitReset ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
Tmp1 = "The following bits on '" & Tmp & "' are not Set (False) " & Chr$(13) & Chr$(13)
j = True
Do
j = cFindBitReset(Tmp, j)
If (j <> True) Then Tmp1 = Tmp1 & j & ", "
Loop Until (j = True)
Tmp1 = Left$(Tmp1, Len(Tmp1) - 1)
Tmp1 = Tmp1 & Chr$(13) & Chr$(13)
j = 0
cStartBasisTimer
For i = 1 To Item
j = cFindBitReset(Tmp, j)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFindBitSet ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
Tmp1 = "The following bits on '" & Tmp & "' are Set (True) " & Chr$(13) & Chr$(13)
j = True
Do
j = cFindBitSet(Tmp, j)
If (j <> True) Then Tmp1 = Tmp1 & j & ", "
Loop Until (j = True)
Tmp1 = Left$(Tmp1, Len(Tmp1) - 1)
Tmp1 = Tmp1 & Chr$(13) & Chr$(13)
j = 0
cStartBasisTimer
For i = 1 To Item
j = cFindBitSet(Tmp, j)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFindFileInEnv ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = cFindFileInEnv("win.com", "windir")
Tmp1 = "The file 'win.com' is " & IIf(j, "found", "not found") & " in the WINDIR" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFindFileInEnv("win.com", "windir")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFindFileInPath ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = cFindFileInPath("win.com")
Tmp1 = "The file 'win.com' is " & IIf(j, "found", "not found") & " in the PATH" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cFindFileInPath("win.com")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestFullPath ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Long
Tmp1 = ""
Tmp = "C:\AUTOEXEC.BAT"
Tmp1 = Tmp1 & "Full Path of " & Tmp & " is " & cFullPath(Tmp) & Chr$(13) & Chr$(13)
Tmp = cGetSystemDirectory() & "\TIME2WIN.DLL"
Tmp1 = Tmp1 & "Full Path of " & Tmp & " is " & cFullPath(Tmp) & Chr$(13) & Chr$(13)
Tmp = cFilesInDirectory(cGetDefaultCurrentDir() + "\*.*", True)
Tmp1 = Tmp1 & "Full Path of " & Tmp & " is " & cFullPath(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cFullPath(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestGetBit ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "bit 0,7,3 of [" & Tmp & "] is "
Tmp1 = title & cGetBit(Tmp, 0) & " " & cGetBit(Tmp, 7) & " " & cGetBit(Tmp, 3) & " " & Chr$(13) & Chr$(13)
title = "bit 23,30,38 of [" & Tmp & "] is "
Tmp1 = Tmp1 & title & cGetBit(Tmp, 23) & " " & cGetBit(Tmp, 30) & " " & cGetBit(Tmp, 38) & " " & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cGetBit(Tmp, i)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetBlock ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "The 2,4,1 of 2 chars of [" & Tmp & "] are "
Tmp = Text1.Text
Tmp1 = title & "2:" & cGetBlock(Tmp, 2, 2) & " | 4:" & cGetBlock(Tmp, 4, 2) & " | 1:" & cGetBlock(Tmp, 1, 2) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetBlock(Tmp, 1, 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetCurrentDrive ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetCurrentDrive()
Tmp1 = Tmp & " is the current drive" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetCurrentDrive()
If (Tmp <> Tmp2) Then Beep
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetDateSeparator ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetDateSeparator()
Tmp1 = "The following char '" & Tmp & "' is the date separator" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetDateSeparator()
If (Tmp <> Tmp2) Then Beep
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetDefaultCurrentDir ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetDefaultCurrentDir()
Tmp1 = Tmp & " is the current dir on the default drive" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetDefaultCurrentDir()
If (Tmp <> Tmp2) Then Beep
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetDiskFree ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = 1 To 26
k = cGetDiskFree(Chr$(64 + i))
If (k <> True) Then
Tmp1 = Tmp1 & "DiskFree for '" & Chr$(64 + i) & ":' is " & k & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cGetDiskFree("C")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetDiskSpace ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = 1 To 26
k = cGetDiskSpace(Chr$(64 + i))
If (k <> True) Then
Tmp1 = Tmp1 & "DiskSpace for '" & Chr$(64 + i) & ":' is " & k & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cGetDiskSpace("C")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetDiskUsed ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
Tmp1 = ""
For i = 1 To 26
k = cGetDiskUsed(Chr$(64 + i))
If (k <> True) Then
Tmp1 = Tmp1 & "DiskUsed for '" & Chr$(64 + i) & ":' is " & k & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cGetDiskUsed("C")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetDriveCurrentDir ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = ""
For i = 1 To 26
Tmp = cGetDriveCurrentDir(Chr$(64 + i))
If (Tmp <> "") Then
Tmp1 = Tmp1 & "The current directory in '" & Chr$(64 + i) & ":' is " & Tmp & Chr$(13)
Else
If (i = 1) Then Tmp1 = Tmp1 & Chr$(9) & "drive A: is missing" & Chr$(13)
If (i = 2) Then Tmp1 = Tmp1 & Chr$(9) & "drive B: is missing" & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetDriveCurrentDir("C")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetFullnameInEnv ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetFullNameInEnv("win.com", "windir")
Tmp1 = "Full path for 'win.com' in 'windir' is " & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp2 = cGetFullNameInEnv("win.com", "windir")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetFullnameInPath ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetFullNameInPath("win.com")
Tmp1 = "Full path for 'win.com' is " & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp2 = cGetFullNameInPath("win.com")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetIn ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "The 2,4,1 blocks of [" & Tmp & "] are "
Tmp = Text1.Text
Tmp1 = title & "2:" & cGetIn(Tmp, "/", 2) & " | 4:" & cGetIn(Tmp, "/", 4) & " | 1:" & cGetIn(Tmp, "/", 1) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetIn(Tmp, "/", 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetNetConnection ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim ErrCode As Integer
Tmp1 = ""
For i = 1 To 26
Tmp = cGetNetConnection(Chr$(64 + i) & ":", ErrCode)
If (ErrCode = True) Then
Tmp1 = Tmp1 & "'" & Chr$(64 + i) & ":' is " & Tmp & Chr$(13)
End If
Next i
For i = 1 To 3
Tmp = cGetNetConnection("LPT" & i & ":", ErrCode)
If (ErrCode = True) Then
Tmp1 = Tmp1 & "'LPT" & i & ":' is " & Tmp & Chr$(13)
End If
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
Tmp = cGetNetConnection("C", ErrCode)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetSystemDirectory ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetSystemDirectory()
Tmp1 = Tmp & " is the system directory for Windows" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetSystemDirectory()
If (Tmp <> Tmp2) Then Beep
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetTimeSeparator ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetTimeSeparator()
Tmp1 = "The following char '" & Tmp & "' is the time separator" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetTimeSeparator()
If (Tmp <> Tmp2) Then Beep
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGetWindowsDirectory ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cGetWindowsDirectory()
Tmp1 = Tmp & " is the directory for Windows" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGetWindowsDirectory()
If (Tmp <> Tmp2) Then Beep
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestGiveBitPalindrome ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
title = "The followings chars are Bit Palindrome : " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & "chr(0) and " & cBlockCharFromRight(cGiveBitPalindrome(), 1) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cGiveBitPalindrome()
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestHourTo ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "The time 10:00 is " & cHourTo("10:00") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time 23:58 is " & cHourTo("23:58") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time 7:36 is " & cHourTo("7:36") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time :24 is " & cHourTo(":24") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time :4 is " & cHourTo(":4") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time : is " & cHourTo(":") & " minutes" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "The time -10:00 is " & cHourTo("-10:00") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time -23:58 is " & cHourTo("-23:58") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time -7:36 is " & cHourTo("-7:36") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time -:24 is " & cHourTo("-:24") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time -:4 is " & cHourTo("-:4") & " minutes" & Chr$(13)
Tmp1 = Tmp1 & "The time -: is " & cHourTo("-:") & " minutes" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cHourTo("23:59")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub Testing (arrayStr() As String)
End Sub
Sub TestInpBox ()
Dim i As Integer
Dim n As Integer
Dim Tmp As String
Dim Tmp1 As String
Tmp = "'TIME TO WIN'" & Chr$(13) & Chr$(13)
Tmp = Tmp & " is a powerfull data link library for using with Visual Basic 3.0 for Windows." & Chr$(13)
Tmp = Tmp & "It looks very better than the standard message box." & Chr$(13)
Tmp = Tmp & "All push buttons are displayed in French." & Chr$(13)
Tmp = Tmp & "The system menu is also in French."
Tmp1 = cLngInpBox(LNG_FRENCH, Tmp, "Input Box in French", "" & Text1.Text)
Tmp1 = InputBox$("This is a standard input box", "VB INPUT BOX", "" & Text1.Text)
End Sub
Sub TestInsertBlocks ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "A~BC~DEF~GHIJ~"
title = "Insert 'a','bc','def','ghij' into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = title & cInsertBlocks(Tmp, "a~bc~def~ghij") & Chr$(13) & Chr$(13)
title = "Insert '' into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & cInsertBlocks(Tmp, "") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cInsertBlocks(Tmp, "a")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestInsertBlocksBy ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Insert 'a','bc','def','ghij' into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = title & cInsertBlocksBy(Tmp, "a/bc/def/ghij", "/") & Chr$(13) & Chr$(13)
title = "Insert '' into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & cInsertBlocksBy(Tmp, "", "/") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cInsertBlocksBy(Tmp, "a/bc/def/ghij", "/")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestInsertChars ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Insert 'a' from 7 char into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = title & cInsertChars(Tmp, 7, "a") & Chr$(13) & Chr$(13)
title = "Insert '10$' from 2 char into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & cInsertChars(Tmp, 2, "10$") & Chr$(13) & Chr$(13)
title = "Insert '@' from 21 char into [" & Tmp & "] is " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & cInsertChars(Tmp, 21, "@") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cInsertChars(Tmp, 1, "a")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIntoBalance ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = 1234
title = "Convert minutes into balance : " & Chr$(13) & Chr$(13)
Tmp1 = title & Chr$(13)
For i = 0 To 11
Tmp1 = Tmp1 & (j + i) & " { " & cIntoBalanceFill(j + i) & " }" & Chr$(9) & Chr$(9)
Tmp1 = Tmp1 & "{ " & cIntoBalance(j + i) & " }" & Chr$(13)
Next i
Tmp1 = Tmp1 & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cIntoBalanceFill(i)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIntoFixHour ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = 12345
title = "Convert " & j & " minutes into fixed hour : " & Chr$(13) & Chr$(13)
Tmp1 = title & Chr$(13)
For i = 0 To 11
Tmp1 = Tmp1 & "{ " & cIntoFixHour(j, i, True, False) & " }" & Chr$(9) & Chr$(9)
Tmp1 = Tmp1 & "{ " & cIntoFixHour(j, i, False, False) & " }" & Chr$(13)
Next i
Tmp1 = Tmp1 & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cIntoFixHour(12345, 8, True, False)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIntoHour ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = 1234
title = "Convert minutes into hour : " & Chr$(13) & Chr$(13)
Tmp1 = title & Chr$(13)
For i = 0 To 11
Tmp1 = Tmp1 & (j + i) & " { " & cIntoHour(j + i) & " }" & Chr$(13)
Next i
Tmp1 = Tmp1 & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cIntoHour(i)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIntoVarHour ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
title = "Convert minutes into variable hour : " & Chr$(13) & Chr$(13)
Tmp1 = title & Chr$(13)
For i = 1 To 9
Tmp2 = Tmp2 & (10 - i)
Tmp1 = Tmp1 & Tmp2 & " { " & cIntoVarHour(Val(Tmp2)) & " }" & Chr$(13)
Next i
Tmp1 = Tmp1 & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cIntoVarHour(123456789)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIsBitPalindrome ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "[" & Tmp & "] is "
Tmp1 = title & IIf(cIsPalindrome(Tmp), "a Bit Palindrome", " not a Bit Palindrome") & Chr$(13) & Chr$(13)
For i = 1 To 255
If cIsBitPalindrome(Chr$(i)) Then Tmp2 = Tmp2 + Chr$(i) & "(" & i & ")" & Chr$(9)
Next i
title = "The followings chars are Bit Palindrome : " & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & title & Tmp2 & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cIsPalindrome(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIsFileX ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = cFilesInDirectory("*.*", True)
title = "[" & Tmp & "] is "
Tmp1 = title & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFilenameValid(Tmp), " a good filename", " is not a good filename") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFileArchive(Tmp), " archive", " not archive") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFileHidden(Tmp), " hidden", " not hidden") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFileNormal(Tmp), " normal", " not normal") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFileReadOnly(Tmp), " read-only", " not read-only") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFileSubDir(Tmp), " sub-directory", " not sub-directory") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFileSystem(Tmp), " system", " not system") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsFileVolId(Tmp), " volume-id", " not volume-id") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cIsFileArchive(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIsPalindrome ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "[" & Tmp & "] is "
Tmp1 = title & IIf(cIsPalindrome(Tmp), "a Palindrome", " not a Palindrome") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cIsPalindrome(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestIsX ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
Tmp1 = "[" & Tmp & "] is " & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsDigit(Tmp), "Digit", " not Digit") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsXDigit(Tmp), "XDigit", " not XDigit") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsAlpha(Tmp), "Alpha", " not Alpha") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsLower(Tmp), "Lower", " not Lower") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsUpper(Tmp), "Upper", " not Upper") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsAlnum(Tmp), "Alnum", " not Alnum") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsUpper(Tmp), "Upper", " not Upper") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsSpace(Tmp), "Space", " not Space") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsPunct(Tmp), "Punct", " not Punct") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsAscii(Tmp), "Ascii", " not Ascii") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsCsym(Tmp), "Csym", " not Csym") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsCsymf(Tmp), "Csymf", " not Csymf") & Chr$(13)
Tmp1 = Tmp1 & IIf(cIsISBN(Tmp), "ISBN", " not ISBN") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cIsDigit(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestKillDir ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = cMakeDir("c:\testing")
Tmp1 = "Directory 'TESTING' " & IIf(cKillDir("c:\testing") = True, "deleted", "not deleted") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cKillDir("c:\testing")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestKillFile ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Close #1
Open "XY~YX~XY.~~~" For Output As #1
Print #1, "this is a test";
Close #1
Tmp1 = "File XY~YX~XY.~~~ " & IIf(cKillFile("XY~YX~XY.~~~") = True, "destroyed", "not destroyed") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cKillFile("XY~YX~XY.~~~")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestKillFiles ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
For i = 1 To 34
Close #1
Open "C:\XY~YX~XY." & i For Output As #1
Print #1, "this is a test";
Close #1
Next i
Tmp1 = "Number of killed Files from 'C:XY~YX~XY.1' to 'C:XY~YX~XY.34' is " & cKillFiles("C:\XY~YX~XY.*") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cKillFiles("C:\XY~YX~XY.~~~")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestLanguage ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Dim ErrCode As Integer
k = Int(Now)
Tmp1 = ""
For i = LNG_FRENCH To LNG_SPANISH
Tmp1 = Tmp1 + cGetLongDay(i, Weekday(k)) & " " & Day(k) & " " & cGetLongMonth(i, Month(k)) & " " & Year(k) & Chr$(13)
Next i
Tmp1 = Tmp1 + Chr$(13)
For i = LNG_FRENCH To LNG_SPANISH
Tmp1 = Tmp1 + cGetShortDay(i, Weekday(k)) & " " & Day(k) & " " & cGetShortMonth(i, Month(k)) & " " & Year(k) & Chr$(13)
Next i
Tmp1 = Tmp1 + Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cGetLongMonth(LNG_FRENCH, 12)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestLrc ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Chr$(2) & "0a12721536"
Tmp1 = "Lrc for [" & Tmp & "] is " & cLrc(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cLrc(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMakeDir ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = cKillDir("testing")
Tmp1 = "Directory 'TESTING' " & IIf(cMakeDir("testing") = True, "created", "not created") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cMakeDir("testing")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMakePath ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim n As Integer
Dim j As Long
Dim SPLITPATH As tagSPLITPATH
Tmp1 = ""
Tmp = cMakePath("c", "tmp", "test", "dat")
Tmp1 = Tmp1 & "Make Path of (c,tmp,test,dat) is '" & Tmp & "'" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Split Path '" & Tmp & "' into four components is :" & Chr$(13) & Chr$(13)
n = cSplitPath(Tmp, SPLITPATH)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nDrive & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nDir & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nName & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nExt & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cMakePath("c", "tmp", "test", "dat")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestMaxI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
ReDim array(ItemMean) As Integer
Randomize Timer
For i = LBound(array) To UBound(array)
array(i) = RandI * Rnd(1)
List1.AddItem "" & array(i)
Next i
j = cSortI(array())
For i = LBound(array) To UBound(array)
List2.AddItem "" & array(i)
Next i
List2.ListIndex = List2.ListCount - 1
Tmp1 = "The MAX of a integer array of " & (ItemMean + 1) & " elements is " & Chr$(13) & Chr$(13) & cMaxI(array()) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
m = cMaxI(array())
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMeanI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
ReDim array(ItemMean) As Integer
Randomize Timer
m = 0
For i = LBound(array) To UBound(array)
array(i) = Int(RandI * Rnd(1))
m = m + array(i)
List1.AddItem "" & array(i)
Next i
Tmp1 = "The Mean of a integer array of " & (ItemMean + 1) & " elements is " & Chr$(13) & Chr$(13) & cMeanI(array()) & " (" & (m / (UBound(array) - LBound(array) + 1)) & ")" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
m = cMeanI(array())
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMenuChange ()
Call cSysMenuChange(Me.hWnd, 0, "&Restaurer")
Call cSysMenuChange(Me.hWnd, 1, "&Positionner")
Call cSysMenuChange(Me.hWnd, 2, "&Taille")
Call cSysMenuChange(Me.hWnd, 3, "&Ic⌠ne")
Call cSysMenuChange(Me.hWnd, 4, "&Plein Θcran")
Call cSysMenuChange(Me.hWnd, 6, "&Fermer" + Chr$(9) + "Alt+F4")
Call cSysMenuChange(Me.hWnd, 8, "&TΓche" + Chr$(9) + "Ctrl+Esc")
End Sub
Sub TestMin ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Long
Tmp1 = "Min of [32760,1234567] is " & cMin(32760, 1234567) & Chr$(13)
Tmp1 = Tmp1 + "Max of [32760,1234567] is " & cMax(32760, 1234567) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cMin(32760, 1234567)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMinI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
ReDim array(ItemMean) As Integer
Randomize Timer
For i = LBound(array) To UBound(array)
array(i) = RandI * Rnd(1)
List1.AddItem "" & array(i)
Next i
j = cSortI(array())
For i = LBound(array) To UBound(array)
List2.AddItem "" & array(i)
Next i
List2.ListIndex = 0
Tmp1 = "The MIN of a integer array of " & (ItemMean + 1) & " elements is " & Chr$(13) & Chr$(13) & cMinI(array()) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
m = cMinI(array())
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMixChars ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMixChars(Tmp) & Chr$(13) & Chr$(13)
Tmp = "TIME TO WIN"
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMixChars(Tmp) & Chr$(13) & Chr$(13)
Tmp = "Nothing can beat the fox"
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMixChars(Tmp) & Chr$(13) & Chr$(13)
Tmp = Text1.Text
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMixChars(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cMixChars(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMorse ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "SOS"
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMorse(Tmp) & Chr$(13) & Chr$(13)
Tmp = "TIME TO WIN"
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMorse(Tmp) & Chr$(13) & Chr$(13)
Tmp = "Nothing can beat the fox"
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMorse(Tmp) & Chr$(13) & Chr$(13)
Tmp = Text1.Text
Tmp1 = Tmp1 + "MixChars of [" & Tmp & "] is " & cMorse(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cMorse(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestMsgBox ()
Dim i As Integer
Dim n As Integer
Dim Tmp As String
Tmp = "'TIME TO WIN'" & Chr$(13) & Chr$(13)
Tmp = Tmp & " is a powerfull data link library for using with Visual Basic 3.0 for Windows." & Chr$(13) & Chr$(13)
Tmp = Tmp & "It looks very better than the standard message box." & Chr$(13) & Chr$(13)
Tmp = Tmp & "All push buttons are displayed in French." & Chr$(13) & Chr$(13)
Tmp = Tmp & "The system menu is also in French." & Chr$(13) & Chr$(13)
Tmp = Tmp & "A TimeOut of 10 seconds has been activated and displayed."
For i = 0 To 5
Call cLngBoxMsg(LNG_FRENCH, Tmp, i + (16 * i) + 512 + MB_MESSAGE_CENTER + MB_TIMEOUT_10 + MB_DISPLAY_TIMEOUT, "Message Box in French with TimeOut")
Next i
End Sub
Sub TestOneCharFromLeft ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "The 3,7,1 chars from left of [" & Tmp & "] are " & Chr$(13) & Chr$(13)
Tmp = Text1.Text
Tmp1 = title & "3:" & cOneCharFromLeft(Tmp, 3) & " | 7:" & cOneCharFromLeft(Tmp, 7) & " | 1:" & cOneCharFromLeft(Tmp, 1) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cOneCharFromLeft(Tmp, 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestOneCharFromRight ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "The 3,7,1 chars from right of [" & Tmp & "] are " & Chr$(13) & Chr$(13)
Tmp = Text1.Text
Tmp1 = title & "3:" & cOneCharFromRight(Tmp, 3) & " | 7:" & cOneCharFromRight(Tmp, 7) & " | 1:" & cOneCharFromRight(Tmp, 1) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cOneCharFromRight(Tmp, 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestPatternExtMatch ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Integer
Tmp2 = "Under the blue sky, the sun lights"
Tmp1 = "PatternExtMatch '" & Tmp2 & "' with" & Chr$(13) & Chr$(13)
Tmp3 = "*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*??*???*?"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*Under*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*sky*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*lights"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "??der*sky*ligh??*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under?the * s??,*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "[U-U][a-z][a-z][a-z][a-z]?the *"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "[U-U][!A-Z][^A-Z][^A-Z][!A-Z]?the *[s-s]"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "~55~6E*~73"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "[Uu][Nn][dD][eE][opqrst]?the *[rstu]"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under?the *[~72~73~74~75]"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13) & Chr$(13)
Tmp3 = "*under*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under*sun"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under t??e*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "[U-U][!a-z][^A-Z][^A-Z][!A-Z]?the *[!s-s]"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "~55~6G*~73"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "[Uu][Nn][dD][eE][opqrst]?the *[rStu]"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under?the *[~72~53~74~75]"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternExtMatch(Tmp2, Tmp3) & Chr$(13) & Chr$(13)
Tmp3 = "Under?the * s??,*"
cStartBasisTimer
For i = 1 To Item
j = cPatternExtMatch(Tmp2, Tmp3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestPatternMatch ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim j As Integer
Tmp2 = "Under the blue sky, the sun lights"
Tmp1 = "PatternMatch '" & Tmp2 & "' with" & Chr$(13) & Chr$(13)
Tmp3 = "*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*??*???*?"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*Under*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*sky*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "*lights"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "??der*sky*ligh??*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under?the * s??,*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13) & Chr$(13)
Tmp3 = "*under*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under*sun"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13)
Tmp3 = "Under t??e*"
Tmp1 = Tmp1 & "'" & Tmp3 & "' is " & cPatternMatch(Tmp2, Tmp3) & Chr$(13) & Chr$(13)
Tmp3 = "Under?the * s??,*"
cStartBasisTimer
For i = 1 To Item
j = cPatternMatch(Tmp2, Tmp3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestReadLanguage ()
Load Form2
Form2.Show
End Sub
Sub TestRemoveBlockChar ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Removing 3 chars from the 7 of [" & Tmp & "] is "
Tmp = cRemoveBlockChar(Tmp, 7, 3)
Tmp1 = title & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cRemoveBlockChar(Tmp, 1, 2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestRemoveOneChar ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Removing the 7 char of [" & Tmp & "] is "
Tmp = cRemoveOneChar(Tmp, 7)
Tmp1 = title & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cRemoveOneChar(Tmp, 1)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestRenameFile ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
j = cKillFile("XY~YX~XY.~~~")
j = cKillFile("XY-YX-XY.---")
Close #1
Open "XY~YX~XY.~~~" For Output As #1
Print #1, "this is a test";
Close #1
Tmp1 = "File XY~YX~XY.~~~ " & IIf(cRenameFile("XY~YX~XY.~~~", "XY-YX-XY.---") = True, "renamed in XY-YX-XY.---", "is not renamed") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cRenameFile("XY~YX~XY.~~~", "XY-YX-XY.---")
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestResizeString ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
Tmp1 = Tmp & " is resized from " & Len(Tmp) & " to 5 chars " & cResizeString(Tmp, 5) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cResizeString(Tmp, 3)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestResizeStringAndFill ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
Tmp1 = Tmp & " is resized from " & Len(Tmp) & " to 35 chars and lengthened with @ is " & Chr$(13) & Chr$(13) & cResizeStringAndFill(Tmp, 35, "@") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cResizeStringAndFill(Tmp, 35, "@")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestReverse ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Reverse of [" & Tmp & "] is "
Tmp1 = title & cReverse(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cReverse(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestReverseAllBits ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Reverse all bits of [" & Tmp & "] is "
Call cReverseAllBits(Tmp)
Tmp1 = title & Tmp & Chr$(13) & Chr$(13)
title = "Reverse all bits of [" & Tmp & "] is "
Call cReverseAllBits(Tmp)
Tmp1 = Tmp1 & title & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cReverseAllBits(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestReverseAllBitsByChar ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Reverse all bits by char of [" & Tmp & "] is "
Call cReverseAllBitsByChar(Tmp)
Tmp1 = title & Tmp & Chr$(13) & Chr$(13)
title = "Reverse all bits by char of [" & Tmp & "] is "
Call cReverseAllBitsByChar(Tmp)
Tmp1 = Tmp1 & title & Tmp & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cReverseAllBitsByChar(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestReverseSortI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Integer
ReDim array(ItemMean) As Integer
Randomize Timer
For i = LBound(array) To UBound(array)
array(i) = RandI * Rnd(1)
List1.AddItem "" & array(i)
Next i
j = cReverseSortI(array())
For i = LBound(array) To UBound(array)
List2.AddItem "" & array(i)
Next i
cStartBasisTimer
For i = 1 To ItemFile
j = cReverseSortI(array())
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestRtoA ()
Dim Tmp As String
Dim Tmp1 As String
Tmp = UCase$(cArabicToRoman(Year(Int(Now))))
Tmp1 = Tmp & " in Arabic is " & cRomanToArabic(LCase$(Tmp)) & Chr$(13)
Tmp = UCase$(cArabicToRoman(Year(Int(Now)) - 1))
Tmp1 = Tmp1 & Tmp & " in Arabic is " & cRomanToArabic(LCase$(Tmp)) & Chr$(13)
Tmp = UCase$(cArabicToRoman(Year(Int(Now)) + 1))
Tmp1 = Tmp1 & Tmp & " in Arabic is " & cRomanToArabic(LCase$(Tmp)) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestSetAllBits ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Set all bits of [" & Tmp & "] on True is "
Call cSetAllBits(Tmp, True)
Tmp1 = title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
title = "Set all bits of [" & Tmp & "] on False is "
Call cSetAllBits(Tmp, False)
Tmp1 = Tmp1 & title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cSetAllBits(Tmp, True)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSetBit ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Set bit 0,5,3 of [" & Tmp & "] on True is "
Call cSetBit(Tmp, 0, True)
Call cSetBit(Tmp, 5, True)
Call cSetBit(Tmp, 3, True)
Tmp1 = Tmp1 & title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
title = "Set bit 22,30,38 of [" & Tmp & "] on False is "
Call cSetBit(Tmp, 22, False)
Call cSetBit(Tmp, 30, False)
Call cSetBit(Tmp, 38, False)
Tmp1 = Tmp1 & title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
title = "Set bit 0,5,3 of [" & Tmp & "] on False is "
Call cSetBit(Tmp, 0, False)
Call cSetBit(Tmp, 5, False)
Call cSetBit(Tmp, 3, False)
Tmp1 = Tmp1 & title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
title = "Set bit 22,30,38 of [" & Tmp & "] on True is "
Call cSetBit(Tmp, 22, True)
Call cSetBit(Tmp, 30, True)
Call cSetBit(Tmp, 38, True)
Tmp1 = Tmp1 & title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cSetBit(Tmp, 7, True)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSetI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
ReDim array(ItemMean) As Integer
Randomize Timer
For i = LBound(array) To UBound(array)
array(i) = 0
List1.AddItem "" & array(i)
Next i
j = cSetI(array(), 1024)
For i = LBound(array) To UBound(array)
List2.AddItem "" & array(i)
Next i
Tmp1 = Tmp1 & "Set 1024 to element 1 of an integer array is : " & array(1) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "Set 1024 to element " & ItemMean & " of an integer array is : " & array(ItemMean) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
j = cSetI(array(), 1.11)
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSortI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Integer
ReDim array(ItemMean) As Integer
Randomize Timer
For i = LBound(array) To UBound(array)
array(i) = RandI * Rnd(1)
List1.AddItem "" & array(i)
Next i
j = cSortI(array())
For i = LBound(array) To UBound(array)
List2.AddItem "" & array(i)
Next i
cStartBasisTimer
For i = 1 To ItemFile
j = cSortI(array())
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSplitPath ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim Tmp3 As String
Dim i As Integer
Dim n As Integer
Dim j As Long
Dim SPLITPATH As tagSPLITPATH
Tmp1 = ""
Tmp = "C:\AUTOEXEC.BAT"
Tmp1 = Tmp1 & "Split Path " & Tmp & " into four components is :" & Chr$(13) & Chr$(13)
n = cSplitPath(Tmp, SPLITPATH)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nDrive & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nDir & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nName & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nExt & Chr$(13) & Chr$(13)
Tmp = cGetSystemDirectory() & "\TIME2WIN.DLL"
Tmp1 = Tmp1 & "Split Path " & Tmp & " into four components is :" & Chr$(13) & Chr$(13)
n = cSplitPath(Tmp, SPLITPATH)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nDrive & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nDir & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nName & Chr$(13)
Tmp1 = Tmp1 & Space$(3) & SPLITPATH.nExt & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
n = cSplitPath(Tmp, SPLITPATH)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000) & Chr$(13) & Chr$(13)
Label3.Caption = Tmp1
End Sub
Sub TestStringCRC32 ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
Tmp = Text1.Text
title = "CRC32 for string [" & Tmp & "] is "
Tmp1 = title & Hex$(cStringCRC32(Tmp)) & Chr$(13) & Chr$(13)
title = "CRC32 for string [" & cReverse(Tmp) & "] is "
Tmp1 = Tmp1 & title & Hex$(cStringCRC32(cReverse(Tmp))) & Chr$(13) & Chr$(13)
title = "CRC32 for string [" & LCase$(Tmp) & "] is "
Tmp1 = Tmp1 & title & Hex$(cStringCRC32(LCase$(Tmp))) & Chr$(13) & Chr$(13)
title = "CRC32 for string [" & LCase$(cReverse(Tmp)) & "] is "
Tmp1 = Tmp1 & title & Hex$(cStringCRC32(LCase$(cReverse(Tmp)))) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
k = cStringCRC32(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSubDirectory ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim k As Long
title = "The 7 first directories in this directory are" & Chr$(13) & Chr$(13)
Tmp1 = title
Tmp2 = cSubDirectory("*.*", True)
For i = 1 To 7
Tmp1 = Tmp1 & Tmp2 & Chr$(13)
Tmp2 = cSubDirectory("*.*", False)
Next i
Tmp1 = Tmp1 & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp = cSubDirectory("*.*", True)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSumI ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Dim m As Double
ReDim array(ItemMean) As Integer
Randomize Timer
m = 0
For i = LBound(array) To UBound(array)
array(i) = Int(RandI * Rnd(1))
m = m + array(i)
List1.AddItem "" & array(i)
Next i
Tmp1 = "The Sum of a integer array of " & (ItemMean + 1) & " elements is " & Chr$(13) & Chr$(13) & cSumI(array()) & " (" & m & ")" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To ItemFile
m = cSumI(array())
Next i
Tmp1 = Tmp1 & "speed for " & ItemFile & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSwap ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Long
Dim i1 As Integer
Dim i2 As Integer
Dim s1 As String
Dim s2 As String
i1 = 3276
i2 = 12345
s1 = "Hello"
s2 = "World"
Tmp1 = "SwapI of [" & i1 & "," & i2 & "] is "
Call cSwapI(i1, i2)
Tmp1 = Tmp1 + "[" & i1 & "," & i2 & "]" & Chr$(13)
Tmp1 = Tmp1 + "SwapI of [" & i1 & "," & i2 & "] is "
Call cSwapI(i1, i2)
Tmp1 = Tmp1 + "[" & i1 & "," & i2 & "]" & Chr$(13)
Tmp1 = Tmp1 + "SwapStr of [" & s1 & "," & s2 & "] is "
Call cSwapStr(s1, s2)
Tmp1 = Tmp1 + "[" & s1 & "," & s2 & "]" & Chr$(13)
Tmp1 = Tmp1 + "SwapStr of [" & s1 & "," & s2 & "] is "
Call cSwapStr(s1, s2)
Tmp1 = Tmp1 + "[" & s1 & "," & s2 & "]" & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cSwapI(i1, i2)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestSysMenuChange (Language As Integer)
Call cLngSysMenu(Language, Me.hWnd)
End Sub
Sub TestTimeBetween ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "The time between 10:00 and 12:01 is " & cTimeBetween(600, 721) & " minutes" & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "The time between 23:58 and 01:02 is " & cTimeBetween(1438, 62) & " minutes" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cTimeBetween(0, 1439)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestTimer ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
title = "The elapsed time for a empty loop of 32766 iterations is "
cStartBasisTimer
For i = 1 To 32766
Next i
Tmp1 = title & cReadBasisTimer() & " ms" & Chr$(13) & Chr$(13)
title = "The elapsed time for a integer loop of 32766 iterations is "
cStartBasisTimer
For i = 1 To 32766
j = j + 1
Next i
Tmp1 = Tmp1 & title & cReadBasisTimer() & " ms" & Chr$(13) & Chr$(13)
title = "The elapsed time for a string loop of 10000 iterations is "
cStartBasisTimer
For i = 1 To 10000
Tmp2 = Tmp2 + "a"
Next i
Tmp1 = Tmp1 & title & cReadBasisTimer() & " ms" & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cReadBasisTimer()
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestToggleAllBits ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Toggle all bits of [" & Tmp & "] is "
Call cToggleAllBits(Tmp)
Tmp1 = title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
title = "Toggle all bits of [" & Tmp & "] is "
Call cToggleAllBits(Tmp)
Tmp1 = Tmp1 & title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cToggleAllBits(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestToggleBit ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = Text1.Text
title = "Toggle bit 7,22,15 of [" & Tmp & "] is "
Call cToggleBit(Tmp, 7)
Call cToggleBit(Tmp, 22)
Call cToggleBit(Tmp, 15)
Tmp1 = title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
title = "Toggle bit 7,22,15 of [" & Tmp & "] is "
Call cToggleBit(Tmp, 7)
Call cToggleBit(Tmp, 22)
Call cToggleBit(Tmp, 15)
Tmp1 = Tmp1 & title & "[" & Tmp & "] " & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Call cToggleBit(Tmp, i)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestTrueBetween ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "601 is not true between 720 and 840 => " & cTrueBetween(601, 720, 840) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "601 is true between 540 and 602 => " & cTrueBetween(601, 540, 602) & Chr$(13) & Chr$(13)
Tmp1 = Tmp1 & "61 is not true between 61 and 62 => " & cTrueBetween(61, 61, 62) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
j = cTrueBetween(720, 0, 1439)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestUncompact ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp = "987654321"
title = "Uncompact '" & Tmp & "' is "
Tmp1 = title & cUncompact(Tmp) & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cUncompact(Tmp)
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestUniqueFileName ()
Dim title As String
Dim Tmp As String
Dim Tmp1 As String
Dim Tmp2 As String
Dim i As Integer
Dim j As Integer
Tmp1 = "Generate unique filename with template WN is " & cUniqueFileName("WN") & Chr$(13) & Chr$(13)
cStartBasisTimer
For i = 1 To Item
Tmp2 = cUniqueFileName("WN")
Next i
Tmp1 = Tmp1 & "speed for " & Item & " = " & (cReadBasisTimer() / 1000)
Label3.Caption = Tmp1
End Sub
Sub TestWindowsIni ()
Dim Tmp As String
Tmp = Tmp + "DateSeparator is " + cGetDateSeparator() + Chr$(13)
Tmp = Tmp + "TimeSeparator is " + cGetTimeSeparator() + Chr$(13)
Tmp = Tmp + "ListSeparator is " + cGetListSeparator() + Chr$(13)
Tmp = Tmp + "DateFormat is " + cGetDateFormat() + Chr$(13)
Tmp = Tmp + "HourFormat is " + cGetHourFormat() + Chr$(13)
Tmp = Tmp + "Currency is " + cGetCurrency() + Chr$(13)
Tmp = Tmp + "Language is " + cGetLanguage() + Chr$(13)
Tmp = Tmp + "Country is " + cGetCountry() + Chr$(13)
Tmp = Tmp + "CountryCode is " + cGetCountryCode() + Chr$(13)
Label3.Caption = Tmp
End Sub
Sub TestWinINI1 ()
Label3.Caption = cGetDevices() & Chr$(13) & Chr$(13) & "Length = " & Len(cGetDevices())
End Sub
Sub TestWinINI2 ()
Label3.Caption = cGetPrinterPorts() & Chr$(13) & Chr$(13) & "Length = " & Len(cGetPrinterPorts())
End Sub
Sub TestWinINI3 ()
Label3.Caption = cGetWinSection("windows") & Chr$(13) & Chr$(13) & "Length = " & Len(cGetWinSection("windows"))
End Sub