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
tengjunbin
Newbie


Joined: 26 Oct 2004
Posts: 6

PostPosted: Tue Oct 26, 2004 6:37 am   

using string lists with mxp commands for status windows...
 
I have a string list with things that I want to display in the status window, for example:

#var teststring {"~<s~>abc~<~/s~>|~<u~>def~<~/u~>|~<b~>bold~<~/b~>"}

and I want to display it in the status window such that if I modify this list, the status window will change as well:

#stw {%item(@teststring,1) %cr %item(@teststring,2) %cr %item(@teststring,3) }

However, the MXP commands don't seem to come out right. the < and >'s are always stripped for some weird reason.


If, however, I use arrays:

#var teststring {%array("~<s~>abc~<~/s~>","~<u~>def~<~/u~>","~<b~>bold~<~/b~>")}

and I display it as:

#stw {%arrget(teststring,1) %cr %arrget(teststring,2) %cr %arrget(teststring,3) }

everything comes out right.


The problem is, I want the display using string lists because they are easier to handle and because you cannot duplicate an array easily (refer to my previous post).

Is there a way this can be done?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Oct 26, 2004 11:58 am   
 
Your fist example works fine for me in 7.05.

strikes
Underlines
bolds

those values in my status window....

Also instead of using the %item method you can use
%expandlist(@teststring,%cr)

IF you still can't get it to work try this
#var teststring {"~<s~>abc~<~/s~>|~<u~>def~<~/u~>|~<b~>bold~<~/b~>"}
#SHOW @teststring
#SHOW %quote(@teststring)

and give us the output
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
tengjunbin
Newbie


Joined: 26 Oct 2004
Posts: 6

PostPosted: Wed Oct 27, 2004 4:18 am   
 
I can't use expandlist.. the code I use is closer to:

%item(@isstrike,1)%item(@itemlist,1)%item(@isstrikeend,1)
%item(@isstrike,2)%item(@itemlist,2)%item(@isstrikeend,2)

etc.

where isstrike = <s>|<s>|<s> or |||| or some permutation in between.. depending on whether itemX should be struck.

Basically this gives me a list of items, and I can choose whether to strike them out (strikeendX = </s> if strikeX = <s>)


the problems lie in the isstrike vars.


i'll try your other suggestions when i get home.
Reply with quote
tengjunbin
Newbie


Joined: 26 Oct 2004
Posts: 6

PostPosted: Wed Oct 27, 2004 6:12 am   
 
I managed to fix the status window bit.. but now I'm stuck with a new problem.

I have the list of strikethrus:

#var StrikeThru "~<s~>|||~<s~>"

now I wish to make the Xth element a strike thru as well... but doing:

#var StrikeThru %replaceitem("~<s~>",@X,@StrikeThru)

converts all the previous <s> to s.. which gives me this list:

s|<s>||s (assuming @X = 2)

What I want is to be able to add in a <s> without affect the rest of the <s>'s...
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Oct 27, 2004 10:18 am   
 
Turn off 'Use <> for expansion' in the Preferences|Script Parser section. I personally find this shortcut totally unnecessary and since your working with heavy MXP formatting it is actually getting in the way.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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