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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Ghaleon
Newbie


Joined: 16 Mar 2003
Posts: 7

PostPosted: Mon Apr 26, 2004 4:47 am   

Comma Problem
 
Is anyone else having problems with commas interfering?

In the mud I play on there is the typical list of items in the room.

Example:
You notice longsword, shortsword and shield.

If I have a trigger set up such as the following:
You notice (*).$
and echo it, it comes out fine.

If I try to do anything with that string though via any functions, it stops at the comma? Ive tried using %string to transform it into a big string, nothing works it continually stops at the comma.
The example above would come out as just 'longsword' if it was used like this:

TRIGGER: You notice (*).$
VALUE: #var TempVar %1

I would like to know a way i could turn this into a stringlist but i tried replacing the ',' and 'and' with '|' and that still came out all messed up. Is there a problem with this new version?

Thanks
Ghaleon
Reply with quote
Ghaleon
Newbie


Joined: 16 Mar 2003
Posts: 7

PostPosted: Mon Apr 26, 2004 5:01 am   
 
Problem solved
I have it now putting it into a variable using
@TempVar = %1
and it works, but still, should this still be not working the other way??

Ghaleon
Reply with quote
jessew
Apprentice


Joined: 03 Mar 2003
Posts: 141

PostPosted: Mon Apr 26, 2004 5:20 am   
 
quote it yourself like
#VARIABLE TempVar "%1"


Jesse
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Apr 26, 2004 6:02 pm   
 
You can also skip the variable and use quotes in the functions.
Converting strings to lists has no problems I'm aware of.

#TR {You notice (*).} {
#SAY Without quotes: %upper( %1)
#SAY With quotes: %upper( "%1")
#VAR TempList {%replace( %replace( "%1", ", ", "|"), " and ", "|")}
#SAY {~@TempList is @TempList}
}
#SHOW {Test: You notice longsword, shortsword and shield.}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion 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