Sign in to follow this  
Followers 0
maxcronjob

Limit to # of IF tests?

4 posts in this topic

Hi,

I seemed to have hit a wall in my script. I'm using AutoIt to test the installed software and hardware on a system. I'm using a lot of assertion tests and the last test I was using was where I took the results from the "systeminfo" command line call and am extracting line-by-line from a text document and testing for certain values.

Basically, I came to a point in my script where an If test seems to be bringing back it's own logic.

e.g:

If $This = "01" OR "02" Then

If $Line41 = "1" OR "2" OR "3" OR "4" Then

If $Line41 = "1" Then

do all this

ElseIf $Line41 = "2" OR "3" OR "4" Then

do all this

Else

write this to the log

EndIf

EndIf

EndIf

So I actually capture what the $Line41 is in my Log and it's a "[". Only the test is seeing it as "1".

Maybe my script is too much for AutoIt to handle.

Any suggestions?

max

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

If $This = "01" OR "02" Then

  If $Line41 = "1" OR "2" OR "3" OR "4" Then

<{POST_SNAPBACK}>

Wrong OR syntax:

If $This = "01" Or $This = "02" Then
    If $Line41 = "1" Or $Line41 = "2" Or $Line41 = "3" Or $Line41 = "4" Then
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I also like to use CASE, very clean in many cases. :)


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Okay, so the documentation for the OR operator wasn't as detailed as your response.

You guys ROCK!

Did I fail to mention how much you guys ROCK!!!???

thanks again.

max

:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0