![](templates/Classic/images/spacer.gif) |
nexela Wizard
![](images/avatars/3549517644153b10a6a2fb.jpg)
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Wed Oct 18, 2006 12:13 am
[1.10] #PSUB not working |
Syntax: #PSUB text [XStart] [XEnd] [YStart] [YEnd]
Psub seems to not be expanding its xstart xend etc arguments, or $local variables
Replaces the whole line, also show that %x2 has the correct start and end position
#TRIGGER {TEST (ABC) (DEF) (GHI)} {#PSUB {JKLM} %x2;#SAY %x2}
Output: JKLM9 11
Working example if you use the actual position numbers
#TRIGGER {TEST (ABC) (DEF) (GHI)} {#PSUB {JKLM} 9 11}
Output: TEST ABC JKLM GHI
Also $Local variables are not expanded inside the PSUB but %n and @Variable refrences are.
#TRIGGER {TEST (ABC) (DEF) (GHI)} {$test=JKLM#PSUB {$test} 9 11}
Output:TEST ABC $test GHI
My zmud workaround to %xn returning both start and end pos. basicly this needs to work with cmud too. It returns the first number of %x10 and the last number of %x11 +1. for the xstart and xend positions
#PSUB {%10/$mvc} %word( %x10, 1) %eval( %word( %x11, 2)+1) |
|
|
![](templates/Classic/images/spacer.gif) |
Zugg MASTER
![](images/avatars/164475849040f41c23b22fe.gif)
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Oct 18, 2006 1:48 am |
Thanks for the note. When I was working on PCOL, I forgot that PSUB needed to also be modified. In zMUD, %x1 was expanded before parsing, so when it contains two values separated by space, zMUD could separate these into two arguments. In CMUD, %x1 is expanded after parsing, and therefore returns only a single argument (two numbers with a space between then), so I have to modify the PSUB command to accept an argument with this format like I did with PCOL.
|
|
|
![](templates/Classic/images/spacer.gif) |
nexela Wizard
![](images/avatars/3549517644153b10a6a2fb.jpg)
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Oct 19, 2006 1:14 am |
On another note about PSUB with the changes to the way cmud evaluates things now how is this gonna be be turned out?
%1=10
var=100
#PSUB {%1/@var}
Will it turn out like
10/100 or will it evaluate and return 0
The first I hope (like Zmud) |
|
|
![](templates/Classic/images/spacer.gif) |
Zugg MASTER
![](images/avatars/164475849040f41c23b22fe.gif)
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Oct 19, 2006 4:56 am |
Should work like in zMUD. The only change to evaluation vs expansion was with the #VAR command, and even then, using {} does expansion and not evaluation. Should be a help topic explaining this kind of stuff soon.
|
|
|
![](templates/Classic/images/spacer.gif) |
|
|