|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Jan 16, 2008 12:20 pm
Loops reversing when triggered from events |
I have an alias, qf, that does a mapquery and then outputs the results in a numbered list.
Problem is, if i call this alias from an event, the order of the list is reversed...
using a #loop 1,3 {#mxp %i} as a simplified example |
|
_________________ The Drake Forestseer |
|
|
|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Jan 16, 2008 12:25 pm |
a fix for it was to do #alarm {+0.001} {qf}, but still, it's starting to defeat the purpose when you have to make events write alarms for their actions to perform correctly
|
|
_________________ The Drake Forestseer |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jan 16, 2008 12:43 pm |
Interestingly, this isn't universal. I did this test:
Code: |
#event test {#loop 1,3 {#say lol %i}
#loop 1,3 {#mxp lol %i}
#loop 1,3 {#mxp %i}}
#raise test |
which output
Quote: |
lol 1
lol 2
lol 3
lol 3
lol 2
lol 1 |
Using an alias instead gave the expected result
Quote: |
lol 1
lol 2
lol 3
lol 1
lol 2
lol 3
|
Definitely some sort of bug here. However, read the help file for #MXP alluran - the command takes two parameters, the first one of which is optional and a number. In the third test case in the alias, CMUD (correctly) thinks that there is no text parameter. Make sure that's what you want to happen. |
|
|
|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Jan 16, 2008 12:46 pm |
The #mxp %i was just an example, i didn't actually test that, the mxp string is rather more complex, it was more just pointing out the method i was using to show data was #mxp incase that was somehow interfering with the loops too.
|
|
_________________ The Drake Forestseer |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jan 16, 2008 6:22 pm |
The #MXP command is more for internal testing purposes. Try using the #SHOW command instead. The #SHOW command forces the line to be processed immediately rather than just adding it to the text queue like #SAY does. And yes, the first argument of #MXP is the mode. So you should be using:
#MXP {lol %i}
and
#MXP {%i}
as the proper syntax. |
|
|
|
alluran Adept
Joined: 14 Sep 2005 Posts: 223 Location: Sydney, Australia
|
Posted: Wed Jan 16, 2008 11:03 pm |
When i get up to re-writing that package (i decided my initial structure decisions weren't optimum) i'll copy past the entire line. I was using mxp to output a piece of clickable text... and it worked fine as a pure alias.
|
|
_________________ The Drake Forestseer |
|
|
|
|
|