Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: 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)
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: 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)
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net