Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching multiple rows 1

Status
Not open for further replies.

jrcampb

Programmer
Apr 9, 2012
11
0
0
US
Below for row "18" I need to also check rows 19 through 24... what would be the best way to do this?

Thanks

Code:
If Sess0.Screen.getstring(18, 2, 4) = "OPEN" Then
            Select Case Sess0.Screen.getstring(18, 10, 6)
                Case "LGLLIT", "DOSLIT", "LGLSCU", "6"
                    iLitigation = "**YES**"
                    iMediation = "No"
                Case "FCDAP "
                    iMediation = "**YES**"
                    iLitigation = "No"
                Case Else
                    iLitigation = "No"
                    iMediation = "No"
            End Select
        Else
            iLitigation = "No"
            iMediation = "No"
        End If
 
something like this maybe?
Code:
If Sess0.Screen.getstring(18, 2, 4) = "OPEN" Then

    [blue]For i = 19 To 24[/blue]
        Select Case Sess0.Screen.getstring([blue]i[/blue],10, 6)
            Case "LGLLIT", "DOSLIT", "LGLSCU", "6"  '[blue]"6" may not work correctly[/blue]
                iLitigation = "**YES**"
                iMediation = "No"
            Case "FCDAP "
                iMediation = "**YES**"
                iLitigation = "No"
            Case Else
                iLitigation = "No"
                iMediation = "No"
        End Select
    [blue]Next i[/blue]
Else

    iLitigation = "No"
    iMediation = "No"
    
End If
 
I think this is what I was looking for, I'll test it out -

Oh the 6 shouldn't even be there - thanks for spotting that for me
 

you need to be careful that any STRING EQUALTITIES that you test are not padded with SPACES, like could happen with "6"...
Code:
        Select Case [b]Trim([/b]Sess0.Screen.getstring(i,10, 6)[b])[/b]


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I'm using this an it seems to be working - anything wrong?

Code:
        iLitigation = "No"
        iMediation = "No"
        For i = 18 To 24    
        If Sess0.Screen.getstring(i, 2, 4) = "OPEN" Then
            Select Case Sess0.Screen.getstring(i, 10, 6)
                Case "LGLLIT", "DOSLIT", "LGLSCU", "6"
                    iLitigation = "**YES**"
                    iMediation = "No"
                Case "FCDAP "
                    iMediation = "**YES**"
                    iLitigation = "No"
                Case Else
                    iLitigation = "No"
                    iMediation = "No"
            End Select
        Else
            
        End If
        Next i
 


What you posted will NOT work for "6".

Did you read my previous post?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Sorry, posted from the wrong window I had open. Should be this - 6 is out, and redunant variables are out
Code:
        iLitigation = "No"
        iMediation = "No"
        For i = 18 To 24    
        If Sess0.Screen.getstring(i, 2, 4) = "OPEN" Then
            Select Case Sess0.Screen.getstring(i, 10, 6)
                Case "LGLLIT", "DOSLIT", "LGLSCU"
                    iLitigation = "YES-Refer caller to F/C Atty"
                Case "FCDAP "
                    iMediation = "YES-Refer caller to F/C Atty"
                Case Else
            End Select
        Else
            
        End If
        Next i
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top