Caption = "Sample Application To Demonstrate STRING.DLL"
ClientHeight = 7035
ClientLeft = 1245
ClientTop = 1710
ClientWidth = 8160
Height = 7725
Left = 1185
LinkTopic = "Form1"
ScaleHeight = 7035
ScaleWidth = 8160
Top = 1080
Width = 8280
Begin SSFrame Frame3D1
Caption = "LexSortStr Demo"
Font3D = 3 'Inset w/light shading
Height = 3405
Left = 120
TabIndex = 10
Top = 3015
Width = 7920
Begin TextBox textnum
Height = 300
Left = 2655
TabIndex = 15
Text = "10"
Top = 1965
Width = 405
End
Begin SSCheck casesens
Caption = "Case sensitive"
Font3D = 0 'None
Height = 285
Left = 2640
TabIndex = 14
Top = 1560
Width = 1935
End
Begin CommandButton Command3
BackColor = &H00000000&
Caption = "Sort the lefthand list into right"
Height = 510
Left = 2595
TabIndex = 13
Top = 900
Width = 2745
End
Begin ListBox List2
Height = 2370
Left = 5400
TabIndex = 12
Top = 315
Width = 2445
End
Begin ListBox List1
Height = 2370
Left = 75
TabIndex = 11
Top = 315
Width = 2445
End
Begin Label Label4
BackStyle = 0 'Transparent
Caption = "# of characters to sort by"
Height = 240
Left = 3105
TabIndex = 16
Top = 2025
Width = 2205
End
End
Begin CommandButton Command5
Caption = "LexSortStr"
Height = 480
Left = 120
TabIndex = 8
Top = 2070
Width = 1755
End
Begin CommandButton Command4
Caption = "FindFirstNIS"
Height = 480
Left = 120
TabIndex = 7
Top = 1515
Width = 1755
End
Begin CommandButton Command2
Caption = "FindRightChar"
Height = 480
Left = 120
TabIndex = 3
Top = 960
Width = 1755
End
Begin TextBox Text2
Height = 975
Left = 1965
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 2
Top = 1815
Width = 6090
End
Begin TextBox Text1
Height = 1125
Left = 1965
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 1
Text = "This is a test string; This is a test string; This is a test string; This is a test string; This is a test string; This is a test string; This is a test string; This is a test string; This is a test string; This is a test string; This is a test string; Th"
'variable used to store the return value of the function call:
Dim ret As Integer
'variables used to time the function call:
Dim tstart As Long
Dim atRev As Long
'initialize the variables
lpstrDATA = Space$(65000)
'when calling dll's, the memory for strings being passed
'back and forth must be allocated by Visual Basic.
'this is done simply by filling up the variable with blanks!
'assign the string to be reversed to the variable:
lpstrDATA = text1.Text
'get the system tick count as a timer mark:
tstart = GetTickCount()
'execute the dll function:
ret = ReverseStr(lpstrDATA)
'get the system tick count as a timer mark:
atRev = GetTickCount()
'assign the resulting string now stored in lpstrDATA to the
'textfield:
text2.Text = Trim$(lpstrDATA)
'please note: all the empty space in a string can easily be eliminated
'by "trimming" the string variable!
MsgBox "It took me " + Trim$(Str$(atRev - tstart)) + " milliseconds to reverse a string 65000 chars length", 64, DLG_CAPTION
If atRev - tstart > 200 Then MsgBox "You must have been reading the about dialog; it normally doesn't take that long! <g> Try it again and it will be *A LOT* faster...", 64, DLG_CAPTION