MU Soapbox

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Muxify
    • Mustard

    Finish to Start Dependency - Something like @wait/wait()? (Tiny)

    MU Code
    3
    4
    1018
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • skew
      skew last edited by

      I'm sure there's something in programming lingo for this. But I'm a project manager, not a programmer, so we get project manager lingo.

      I'm updating my poseorder code, so you can remove someone from the list. I want to flag this person has posed (so it can send the alert to whomever is next), and then remove them. I need the 'has posed' bit of code to run BEFORE the 'remove them' bit of code.

      Here's the actual code snippet:

      	strcat( 
      		u( f.poseorder, %qp ),
      		remit( %1, u( .msg, Pose Order, [name(%2)] has removed [name(%qp)]. )),
      		u( .msg, Pose Order, You remove [name(%qp)]. ),
      		wipe( %ql/d.pose.*.%qp )
      	)
      

      f.poseorder needs to run and finish before the wipe() goes.

      Now, normally, if I needed something delayed I'd just use @wait. But there's not a wait() equivalent that I can put into the strcat(). Unless there is one?

      So, ideas, suggestions... thanks!

      faraday 1 Reply Last reply Reply Quote 0
      • faraday
        faraday @skew last edited by

        @skew I'm not really clear on what you're trying to do with strcat there. But in general, if you do:

        [ u( x ) ] [ u( y ) ]

        Then x will run and finish before y.

        You can use a setq to save the results if you need to (but that gets into the need to localize and other goofiness):

        [ setq( 0 , u( x ) ) ] [ strcat( %q0 , y ) ]

        There is no equivalent to wait() in function programming.

        skew 1 Reply Last reply Reply Quote 1
        • skew
          skew @faraday last edited by

          @faraday Thaaaaank you. @Thenomain also assured me that functions should go in order.

          I swear I've seen things process before other things, but, uh, in this case... I was just being a dummy. Everything is working as it ought to. I had set a little snippet of code to say 'don't alert the person if there's only one person' and was testing with 2 people, and removing 1, so yeah...

          All fixed.

          Mercutio 1 Reply Last reply Reply Quote 0
          • Mercutio
            Mercutio Creator @skew last edited by Mercutio

            @skew

            As long as you remain within the functions, or command-lists, it should be fine.
            It's when your command lists start containing the following specific commands: (@dolist, @wait, @trigger, are the ones I can think of)

            @emit a; @dolist b c d=@emit ##; @emit e; 
            

            That you'll get stuff like:

            a
            e
            b
            c
            d
            

            This is because of how command queues work. This gets resolved with doing stuff like:

            @emit a; @dolist/notify b c d=@emit ##; @wait me=@emit e;
            
            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post