home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
vb_tools
/
vbabk
/
vba_stri.frm
< prev
Wrap
Text File
|
1994-07-03
|
4KB
|
142 lines
VERSION 2.00
Begin Form VBA_STRINGS
Caption = "String Functions"
ClientHeight = 2280
ClientLeft = -15
ClientTop = 840
ClientWidth = 5280
Height = 2685
Left = -75
LinkTopic = "Form1"
ScaleHeight = 2280
ScaleWidth = 5280
Top = 495
Width = 5400
Begin TextBox nth
Height = 285
Left = 3720
TabIndex = 10
Text = "2"
Top = 1680
Width = 375
End
Begin OptionButton Option1
Caption = "nthCol($,%)"
Height = 255
Index = 4
Left = 2160
TabIndex = 9
Top = 1800
Width = 1455
End
Begin OptionButton Option1
Caption = "nthRow($,%)"
Height = 255
Index = 3
Left = 2160
TabIndex = 8
Top = 1560
Width = 1455
End
Begin OptionButton Option1
Caption = "Empty($)"
Height = 255
Index = 2
Left = 120
TabIndex = 7
Top = 2040
Width = 1215
End
Begin OptionButton Option1
Caption = "AllTrim($)"
Height = 255
Index = 1
Left = 120
TabIndex = 6
Top = 1800
Width = 1215
End
Begin TextBox CountChar
Height = 285
Left = 1680
TabIndex = 5
Text = "?"
Top = 1560
Width = 255
End
Begin OptionButton Option1
Caption = "CountStr($,$)"
Height = 255
Index = 0
Left = 120
TabIndex = 4
Top = 1560
Width = 1455
End
Begin TextBox OutputTxt
Height = 285
Left = 720
TabIndex = 3
Text = "Text2"
Top = 1200
Width = 4455
End
Begin TextBox InputTxt
Height = 975
Left = 720
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 2
Text = "Text1"
Top = 120
Width = 4455
End
Begin Label Label1
AutoSize = -1 'True
Caption = "Output"
Height = 195
Index = 1
Left = 120
TabIndex = 1
Top = 1200
Width = 585
End
Begin Label Label1
AutoSize = -1 'True
Caption = "Input:"
Height = 195
Index = 0
Left = 120
TabIndex = 0
Top = 120
Width = 510
End
End
Sub Form_Load ()
t$ = Chr$(9)
InputTxt = " Row1" + t$ + "Cell2" + t$ + "Cell3" + t$ + "Cell4" + Chr(13) + Chr$(10) + "Row2" + Chr(13) + Chr$(10) + "Row3"
End Sub
Sub Option1_Click (Index As Integer)
Select Case Index
Case 0
OutputTxt = Format(CountStr(InputTxt, CountChar))
Case 1
OutputTxt = AllTrim(InputTxt)
Case 2
If Empty(InputTxt) Then
OutputTxt = "-1 (True) -- no signifcant text"
Else
OutputTxt = "0 (False) -- Characters/Numbers etc..."
End If
Case 3
OutputTxt = NthRow(InputTxt, Val(nth))
Case 4
OutputTxt = NthCol(InputTxt, Val(nth))
End Select
End Sub