I need to get the false value if any of the captured words not found in dictionary. But what I got so far is, if it finds at least one word in the dicionary it returns the value true.
Sub stringnotfound()
Dim ibmCurrentTerminal As IbmTerminal
Dim ibmCurrentScreen As IbmScreen
Dim hiddenTextEntry As String
Dim returnValue As Integer
Dim timeout As Integer
Dim waitText As String
Dim alert(0 To 1) As String
timeout = 15000
Set ibmCurrentTerminal = ThisFrame.SelectedView.control
Set ibmCurrentScreen = ibmCurrentTerminal.screen
Dim Pos(1) As String
Dim wordDictonary As String
Dim myArray As Variant
Dim cnt As Long
Dim lin As Long
Dim hasWord As Boolean
wordDictonary = "Lorem ipsum1,Lorem ipsum2,Lorem ipsum3,Lorem ipsum3,Lorem ipsum3,Lorem ipsum4"
myArray = Split(wordDictonary, ",")
If ibmCurrentScreen.GetText(13, 7, 12) <> "" Then Pos(0) = ibmCurrentScreen.GetText(13, 7, 12)
If ibmCurrentScreen.GetText(14, 7, 12) <> "" Then Pos(1) = ibmCurrentScreen.GetText(14, 7, 12)
For lin = 0 To 1
For cnt = LBound(myArray) To UBound(myArray)
If InStr(1, Pos(lin), Trim(myArray(cnt))) Then hasWord = True
Next cnt
Next lin
If hasWord = False Then MsgBox "captured" & MISSING & "words missing from the dictionary"
End Sub
Any help would be greatly appreciated. Thank you.