Jump to content
Sign in to follow this  
Ham123

Looping functions and such.

Recommended Posts

herewasplato

Please test your code inside of SciTE before posting.

Scite would have told you that you cannot put a WEnd line where you had it.

Use Ctrl-T within SciTE.

it would go through

bb() ;bb

other func here() ;other

other func here() ;other

other func here() ;other

cal() ;cal

If pixelgetcolor(x, y) = 0x000000 Then ; then pixel test,

bb() ;if true, goes to bb

Else

cal() ;else goes to cal.

Endif

;after cal

;will go through pixel test one more time

;to see if its true or not?

If pixelgetcolor(x, y) = 0x000000 Then ; then pixel test,

;if true - not sure want you want to do the second time thru

Else

;else - not sure want you want to do the second time thru

Endif

Func bb ()

stuff here

endfunc

other funcs

func cal()

stuff here

end func

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Ham123

Please test your code inside of SciTE before posting.

Scite would have told you that you cannot put a WEnd line where you had it.

Use Ctrl-T within SciTE.

it would go through

bb() ;bb

other func here() ;other

other func here() ;other

other func here() ;other

cal() ;cal

If pixelgetcolor(x, y) = 0x000000 Then ; then pixel test,

bb() ;if true, goes to bb

Else

cal() ;else goes to cal.

Endif

;after cal

;will go through pixel test one more time

;to see if its true or not?

If pixelgetcolor(x, y) = 0x000000 Then ; then pixel test,

;if true - not sure want you want to do the second time thru

Else

;else - not sure want you want to do the second time thru

Endif

Func bb ()

stuff here

endfunc

other funcs

func cal()

stuff here

end func

Basically here is my question. will it only execute bb() once more, or will it literally go BACK to the beginning of the sequence.

Share this post


Link to post
Share on other sites
Ham123

Basically here is my question. will it only execute bb() once more, or will it literally go BACK to the beginning of the sequence.

Share this post


Link to post
Share on other sites
TurionAltec

Please wait before bumping posts. Read my signature

Since you missed reading GEOSoft's signature I've enlarged it for your convenience:

Please wait at least 24 hours before bumping your thread. Consider yourself warned.

17:25 - 22:42 is less than 24 hours

I think the code you want is this, so it keeps running cal() if it fails the colortest, if it passes it restarts the loop at bb()

while 1
    bb()
    other func here()
    other func here()
    other func here()
    cal()
    While pixelgetcolor(x, y) <> 0x000000
        cal()
    Wend
Wend

Share this post


Link to post
Share on other sites
herewasplato

... will it only execute bb() once more, ...

Yes.

... or will it literally go BACK to the beginning of the sequence.

No.

I took what you wrote out as a summary of the code in that post and added semi functional lines of AutoIt code to show how to code each of your statements.

If the layout of code that TurionAltec provided works for you - then you are done. If it does not, work on the code yourself and post the real/functional code that you have to this thread.


[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.