Jump to content

Looping functions and such.


Recommended Posts

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

... 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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...