Jump to content
UBot Underground

increment a variable in a loop


Recommended Posts

Hello everybody ;)


is it possible to increment a variable (#compte0 #compte1 etc...) in a loop like this : 


 



 

set(#inc, 0, "Global")

 

loop(4) {


    if($comparison("#compte{#inc}", "=", "true")) {

        then {

            alert("ok")

        }

        else {

            alert("dead")

        }

    }

     increment(#inc)

}

 

 

I have tried with the Free bulk reset plugin but I must miss something...

 

This is making me crasy, if someone would please help me ?

Link to post
Share on other sites

@zenos

 

Try this on for size.

set(#inc, 0, "Global")
loop(4) {
    if($comparison(#inc, "=", 2)) {
        then {
            alert("inc is equal to 2")
        }
        else {
        }
    }
    increment(#inc)
}

Yes, you can increment variables within a Loop but not in the comparison area of the IF node.  Use that area for doing an actual comparison.

 

Buddy

Link to post
Share on other sites

Thanks for your answer ;) I know how to use comparison, but I really need to dynamcly increment a var like this and to use the comparison to check if my var is true or not...

 

#Compte0

#Compte1

Etc....

 

So after that I need to check if #Compte0 is true or false, #Compte1 is true or false, etc...

Link to post
Share on other sites

use the Dictionary plugin you can use dynamic variables

Thank you but I just don't know how to do it with Dictionnary, if you would please help me that would be really nice...

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...