|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Sat May 23, 2009 5:45 am
[3.08] #nn loops within #ifs |
Code: |
#if (1) {#2 {#echo "test"}} |
This code does not appear to be running, I ran into it when I got an "Argument still on stack" error in another script. Putting it into the command line makes it output "16."
Both
and
Code: |
#if (1) {#echo "test"} |
appear to work on the other hand. |
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Sat May 23, 2009 5:58 am |
Hmmm I get the same problem
additionally
Code: |
#if (1) { #2 {#echo "test"}} {#print test2} |
Generates an invalid token error, and
Code: |
#if (1) { #echo "test"} {#2 #print test2} |
sends.... 52 then 16 |
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Sat May 23, 2009 6:06 am |
Using #loop nn seems to be fine however.
Here's the compiled code for both:
Code: |
#if (1) {#2 {#echo "test"}} |
Code: |
0000 PUSHEXP 0016
0008 JUMP 0036
0016 INT 1
0024 SETEXP 0 0
0036 PUSHLOC 0052
0044 JUMP 0112
0052 INT 2
0060 PUSHLOC 0076
0068 JUMP 0100
0076 LITERAL "test"
0088 CMD echo (1)
0100 CMD repeat (2)
0112 CMD if (1) |
Code: |
#if (1) {#loop 2 {#echo "test"}} |
Code: |
0000 PUSHEXP 0016
0008 JUMP 0036
0016 INT 1
0024 SETEXP 0 0
0036 PUSHLOC 0052
0044 JUMP 0124
0052 INT 2
0060 INT 1
0068 SWAP
0072 PUSHLOC 0088
0080 JUMP 0112
0088 LITERAL "test"
0100 CMD echo (1)
0112 CMD loop (3)
0124 CMD if (2) |
The later having 2 extra lines:
Code: |
0060 INT 1
0068 SWAP |
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jun 01, 2009 6:41 pm |
Confirmed and added to bug list for next version.
|
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Tue Jun 02, 2009 1:03 pm |
hmm just found a further case where #xxx causes problems
From command line:
Code: |
#trigger {test} {#2 jump} |
In the PE I get a trigger with pattern "#2 jump" and 16 sent to the mud |
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
|
|