how to test an attribute after a list of instructions

stefdelecstefdelec Member, PRO Posts: 146

Hi,

I would like to test if an attribute is empty/null or not after a list of instructions.

Attribute.A => list of instruction. After list of instruction if this attribute is empty=> change attribute to 23!

How can I do that?

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Use a Display Text behaviour to monitor the attribute.

  • stefdelecstefdelec Member, PRO Posts: 146

    Yes but I want the attribute to be test only after all the instructions have been executed. Am I clear? ;-/

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2015

    @stefdelec said:
    Yes but I want the attribute to be test only after all the instructions have been executed. Am I clear? ;-/

    I'm 100% sure what you mean, 'after a list of instructions' is a little vague, I'm guessing it's a series of rules ?

  • stefdelecstefdelec Member, PRO Posts: 146

    Yep.
    Change attribute 1=> random(-1;1)
    Change attribute 2=> random(-1;1)

    Rule => if all attribute 1 and 2 = 0 =>the reshuffle.

    (Writing this, I am thinking a "loop" could be a good way! :-) )

  • SocksSocks London, UK.Member Posts: 12,822

    @stefdelec said:
    Yep.
    Change attribute 1=> random(-1;1)
    Change attribute 2=> random(-1;1)

    Rule => if all attribute 1 and 2 = 0 =>the reshuffle.

    Could you not simply place the rule that checks for parity after the two change attribute behaviours in a timer (after 0 seconds) forcing it onto the next cycle of code ? I think that should work (if I understand the question properly) ?

  • stefdelecstefdelec Member, PRO Posts: 146

    Hum. I could, but I ve read that 'timer behaviour' are heavy.

    I did:

    Loop while all conditions are valid
    attribute A = 0

    attribute B = 0

    change attribute A = random(-1,1)
    change attribute B = random(-1,1)

  • SocksSocks London, UK.Member Posts: 12,822

    @stefdelec said:
    Hum. I could, but I ve read that 'timer behaviour' are heavy.

    Not 'After' timers as they only run once, mostly when people refer to timers being processor intensive they are referring to 'Every' timers.

  • stefdelecstefdelec Member, PRO Posts: 146

    Great! Thanks!

Sign In or Register to comment.