|
dogma_chip Newbie
Joined: 29 Jul 2007 Posts: 7
|
Posted: 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? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
dogma_chip Newbie
Joined: 29 Jul 2007 Posts: 7
|
Posted: Sun Jul 29, 2007 1:48 pm |
Thanks for the fast reply.... I'll go with option 2
|
|
|
|
dogma_chip Newbie
Joined: 29 Jul 2007 Posts: 7
|
Posted: 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. |
|
|
|
dogma_chip Newbie
Joined: 29 Jul 2007 Posts: 7
|
Posted: 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 |
|
|
|
|
|