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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can an If statement have more than one codition? 1

Status
Not open for further replies.

brumo

Technical User
May 30, 2008
15
US
The code compiles, but the 'And' doesn't seem valid:
Code:
    s_RtRcvdDt = trim(Sess.Screen.GetString( 10, 06, 15))
    
    if IsDate(s_RtRcvdDt) then
        i_DaysDiff = DateValue(Date()) - DateValue(s_RtRcvdDt)
    End If

    s_RtRcvdJb = trim(Sess.Screen.GetString( 10, 65, 71))

    if i_DaysDiff = 1 And s_RtRcvdJb = "CCM130D" then
        Sess.Screen.MoveTo 10, 2
        Sess.Screen.SendKeys "s<Enter>"
 




Hi,

Attachmate does not seem to support and or operators, whereas VB does. You can do this...
Code:
    if i_DaysDiff = 1 Then
       if s_RtRcvdJb = "CCM130D" then
           Sess.Screen.MoveTo 10, 2
           Sess.Screen.SendKeys "s<Enter>"


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Actually I got the If statement I posted to work. I had a bad length value in the getstring. And it's good to know there's an alternate method. Thanks Skip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top