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
Ins0mniak
Apprentice


Joined: 27 Apr 2001
Posts: 110

PostPosted: Sat Nov 01, 2003 5:59 am   

Insertion of "|" into a string =/
 
Hi, I am not going to go into the complexity of what I am trying to do, but basicly the problem is... when i make a string with the "|" in it, it breaks the string into a string list, of everything before it, and everything after it. It doesnt matter if i put it in as a char(), etc. Is there a way to keep zmud from evaluation a variable with "|" in it without breaking it into a string list? ~| doesnt work either.

Example:
#VAR temp {~{> P~|P~}lease help} is broken into...
1) {> P
2) P}lease help

Instead of the desired {> P|P}lease help
Reply with quote
Ins0mniak
Apprentice


Joined: 27 Apr 2001
Posts: 110

PostPosted: Sat Nov 01, 2003 7:07 am   
 
I figured out a work around, in case anyone else runs into this problem.. the key is expand list [and if nessesary %exec].

#NOOP %exec( ~#TR ~{%expandlist( @temp, "|")~} ~{~#VAR ThisWorked ~{yes~}~})
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Nov 01, 2003 2:52 pm   
 
quote:
I am not going to go into the complexity of what I am trying to do

Why not? It would probably be easier to help if we didn't have to guess what you're trying to accomplish (indirect trigger creation it looks like).

| is the list-separator character. There is no way to put it in a variable without the variable becoming a list or record. That doesn't necessarily make the variable unusable as a string.

#VAR temp {~{> P~|P~}lease help}
#TR {<@temp>} {#VAR ThisWorked {yes}}
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