If-elseif-else

Share your macros, knowledge, solutions, services, ...
Post Reply
Petr
Posts: 106
Joined: Tue Oct 18, 2016 1:12 pm

If-elseif-else

Post by Petr » Mon Nov 14, 2016 4:47 pm

Q: Just wondering, as I am new to this program, is there a way to write an if-else-else (not just if-else) type sequence.

Basically, I'm trying to say if this is true, do that, if this is false, check those, if those is true, do things, if those is false,do something

To be more precise, I want to check a certain pixel, if the color is x, do that, if it is y, do things, if it is z, do something.

So far, I can sort of make it work, but I have to split my code in 2 so it is 2 separate if-else arguments. If I could figure out how to get my code to stay in here properly, I'd post it... As a newb at this, I can't make the [ code ][ / code ](minus the spaces) work.

A: There is not "elseif" command available. If you have many conditions then I would structure the code like this:

Code: Select all

<if>(...)
   do something
   <goto>("Done")
<end><if>(...)
   do something else
   <goto>("Done")
<end><if>(...)
   do something yet else
   <goto>("Done")
<end>
<label>("Done")
Your macro continues here...

Post Reply