Sign in to follow this  
Followers 0
FadetoGrey

Any way to Do...Until two expressions are true? Instead of one?

15 posts in this topic

And also, when you're doing a Do...Until, is there a way you can base the answer on whether a certain expression has an error or not? So I can just add @error instead of =?

Share this post


Link to post
Share on other sites



It is possible .... just use And.

Post and example you tried that isn't working.

It's not that it's not working, it's just using @error is easier for what I'm doing, so is it possible to do a Do...Until Bla = Bla And Blu has an error, or doesn't have an error. How would you code that bit? Would it be Blu = @error? So Do...Until Blu has an error.

Share this post


Link to post
Share on other sites

It's not that it's not working, it's just using @error is easier for what I'm doing, so is it possible to do a Do...Until Bla = Bla And Blu has an error, or doesn't have an error. How would you code that bit? Would it be Blu = @error? So Do...Until Blu has an error.

An example would be much better for us. It's very easy for us to create an example and then for you to say it isn't what you meant. I have personnally wasted hours in these forums doing just that for people :)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

An example would be much better for us. It's very easy for us to create an example and then for you to say it isn't what you meant. I have personnally wasted hours in these forums doing just that for people :)

Instead of true and false, can you do @error or no @error? Nothing complex or anything, very basic, but I just need to know how you would word it.

If you really need an example:

Do 

Send ("1")

Until PixelSearch(0, 0, 1280, 1050, 8213822, 5) = @error And PixelSearch( 569, 31 , 707 , 85, 14099225, 10) = Not @error

Is that how you would put it?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You either have to save de @error results at and test for those or test for a returned Array.

Does this work for you?

Do

Send ("1")

Until Not IsArray(PixelSearch(0, 0, 1280, 1050, 8213822, 5)) And IsArray(PixelSearch( 569, 31 , 707 , 85, 14099225, 10))

Or else maybe:

Do
    Send("1")
    PixelSearch(0, 0, 1280, 1050, 8213822, 5)
    $err1 = @error
    PixelSearch(569, 31, 707, 85, 14099225, 10)
    $err2 = @error
Until $err1 <> 0 And $err2 = 0
Edited by Jos

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

Share this post


Link to post
Share on other sites

You either have to save de @error results at and test for those or test for a returned Array.

Does this work for you?

Do

Send ("1")

Until Not IsArray(PixelSearch(0, 0, 1280, 1050, 8213822, 5)) And IsArray(PixelSearch( 569, 31 , 707 , 85, 14099225, 10))

Or else maybe:

Do
    Send("1")
    PixelSearch(0, 0, 1280, 1050, 8213822, 5)
    $err1 = @error
    PixelSearch(569, 31, 707, 85, 14099225, 10)
    $err2 = @error
Until $err1 <> 0 And $err2 = 0
Could you explain what those 2 mean/do?

Share this post


Link to post
Share on other sites

Could you explain what those 2 mean/do?

What don't you understand?

Pixelsearch will run untill Pixelsearch is not an array variable == no pixel found.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

First example checks if PixelSearch returns an Array. when an Array is returned the functions found the pixel

Second example performs the 2 pixelsearch functions save each @error returned.

Edited by Jos

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

Share this post


Link to post
Share on other sites

#10 ·  Posted

What don't you understand?

Pixelsearch will run untill Pixelsearch is not an array variable == no pixel found.

What's an array variable? What's ==?

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

What's an array variable? What's ==?

See my answer above your last post and I advice you to spend some time first to learn the basics seeing this last question.

There are some nice tutorials available for that, just look at the stickies.

Jos

Edited by Jos

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

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

well... i never use "==" is that a comparing statement? anyway i always use "=" or "<>" ect... but yeah WHAT IS "=="? im kinda curious... i googled it a while back and it says a comparing statement but whats the differece from the others?

EDIT

some typos :)

Edited by CodyBarrett

Share this post


Link to post
Share on other sites

#13 ·  Posted

"Cody" == "Cody" ; is true

"cody" == "Cody" ; is False

it means "exact"

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#14 ·  Posted

hmmm oh ok ahaha.. its case sensitive and "=" isn't thanks

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

well... i never use "==" is that a comparing statement? anyway i always use "=" or "<>" ect... but yeah WHAT IS "=="? im kinda curious... i googled it a while back and it says a comparing statement but whats the differece from the others?

EDIT

some typos :)

Actually I use == because its the comparing statement in C++. A=B means A is B and A==B means check if A is B.

Edited by Qousio

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