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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
dogma_chip
Newbie


Joined: 29 Jul 2007
Posts: 7

PostPosted: Sun Jul 29, 2007 11:58 am   

Displaying Variable content in other window
 
In zmud I was using things like:

:status: #mxp ~<color yellow blue>- @nextmove~</color>

but these do not seem to work in Cmud. The mxp is working because the "- " is displayed in the expected colours. But the variable @nextmove is not expanded or displayed.

:status: #say @nextmove

doesn't seem to work either. I get the feeling that the @nextmove variable is empty for the :status: window. How do I get the content of that variable from the main window displayed in an other window?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Jul 29, 2007 1:40 pm   
 
Yeah, it's a bugger in these situations because variables inside windows aren't visible to anything outside those windows. You have a few options:

1) #exec %concat(":status: #mxp <color yellow blue>- ",@nextmove,"</color>") - not really recommended because #exec is very slow.
2) :status: #mxp ~<color yellow blue>- @//otherwindowname/nextmove~</color> - works well but not if you change the window name.
3) Go into the package editor and make a module to go with your two windows. Keep all your variables inside the module. This way the variables will be visible to any window and the command you already have will start working.

Also, just fyi - the <> characters aren't special characters any more, so you don't need to escape them when you're using MXP. Make sure you escape any "" quotes you use, though.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
dogma_chip
Newbie


Joined: 29 Jul 2007
Posts: 7

PostPosted: Sun Jul 29, 2007 1:48 pm   
 
Thanks for the fast reply.... I'll go with option 2
Reply with quote
dogma_chip
Newbie


Joined: 29 Jul 2007
Posts: 7

PostPosted: Sun Jul 29, 2007 2:37 pm   
 
Hmmm but i can't seem to get it working:

this is the line I'm using now
:status: #mxp <color yellow blue>- @//achaea/nextmove</color>

But it still isn't getting the value of the nextmove variable from the achaea window.
Reply with quote
dogma_chip
Newbie


Joined: 29 Jul 2007
Posts: 7

PostPosted: Sun Jul 29, 2007 2:54 pm   
 
Got it!

I forgot that my variables are all in a map...

:status: #mxp <color yellow blue>- @//achaea/nextmove</color>

Didn't work
But adding the name of that map to the location of the variable, like this:

:status: #mxp <color yellow blue>- @//achaea/Variables/nextmove</color>

Did make it work!!!

Thanks again for your help
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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