Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[b][blue] Case "String1", "String2", "String3", "String4", "String5"
[/blue][/b]
[b][blue]"String1"
"String2"
"String3"
"String4"
"String5"
[/blue][/b]
[b][blue] Dim tsControlFile As TextStream
Dim strControlFile As String
Dim strSelectString As String
Set tsControlFile = fso.OpenTextFile(App.Path & "\ControlFile.txt", ForReading)
Do While Not tsControlFile.AtEndOfStream
strControlFile = tsControlFile.ReadLine
If strSelectString = "" Then
strSelectString = strControlFile
Else
strSelectString = strSelectString & ", " & strControlFile
End If
Loop
[/blue][/b]
[b][blue] Select Case Trim(strRecordType)
Case strSelectString
[/blue][/b]
[blue]
Debug.Print Trim(strRecordType)
Debug.Print strSelectString
[/blue]
Select Case Trim(strRecordType)
Case strSelectString
Option Explicit
Private Coll As Collection
Private Dict As Scripting.Dictionary
Private Sub UpdateUI()
With txtTry
.SetFocus
.SelStart = 0
.SelLength = &H7FFF
End With
End Sub
Private Sub cmdTryColl_Click()
Dim Found As Boolean
On Error Resume Next
Found = Coll(txtTry.Text)
On Error GoTo 0
If Found Then
lblResult.Caption = "Present"
Else
lblResult.Caption = "Missing"
End If
UpdateUI
End Sub
Private Sub cmdTryDict_Click()
If Dict.Exists(txtTry.Text) Then
lblResult.Caption = "Present"
Else
lblResult.Caption = "Missing"
End If
UpdateUI
End Sub
Private Sub Form_Load()
Dim F As Integer
Dim S As String
Set Coll = New Collection 'Always "TextCompare" (case insensitive).
Set Dict = New Scripting.Dictionary
Dict.CompareMode = BinaryCompare 'Not an option with Collections.
F = FreeFile(0)
Open "strings.txt" For Input As #F
Do Until EOF(F)
Line Input #F, S
Coll.Add True, S
Dict.Add S, True
Loop
Close #F
End Sub