×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Searching multiple rows

Searching multiple rows

Searching multiple rows

(OP)
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

RE: Searching multiple rows

something like this maybe?

CODE

If Sess0.Screen.getstring(18, 2, 4) = "OPEN" Then

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

    iLitigation = "No"
    iMediation = "No"
    
End If

RE: Searching multiple rows

(OP)
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

RE: Searching multiple rows


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 Trim(Sess0.Screen.getstring(i,10, 6))

 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Searching multiple rows

(OP)
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

RE: Searching multiple rows



What you posted will NOT work for "6".

Did you read my previous post?

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

RE: Searching multiple rows

(OP)
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
 

RE: Searching multiple rows

you don't really need CASE ELSE or ELSE

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close