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


Joined: 14 Apr 2008
Posts: 105

PostPosted: Wed Apr 30, 2008 11:33 am   

how do I refer to a variable in another sub- window?
 
how do I refer to a variable in another window?

i am making a trigger for a sub-window of the session that colours a word if it matches the pattern "@target" , but the "target" variable is in the main session window and it does not seem to recognise it because of this
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Apr 30, 2008 12:23 pm   
 
The short answer is that you can't. If you want a variable to be visible outside a window, you shouldn't keep it inside the window. Create a module and put the variable in there. Unless the module is external, settings inside the module will always be visible to other settings in the same package.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
deathkitty
Apprentice


Joined: 14 Apr 2008
Posts: 105

PostPosted: Wed Apr 30, 2008 12:53 pm   
 
how do I create a module and what is it? whats the command for editing/creating a variable in a module and how do you refer to it in other things?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Apr 30, 2008 1:29 pm   
 
These things are meant to be done via the package editor.

Open the package editor.
Select the package containing the windows in the tree view.
Click the little down arrow beside the + sign and select module from the list.
Name the module.
Move your triggers and variables into the new module.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Apr 30, 2008 1:53 pm   
 
You can also use the #module command but the GUI is easier.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Apr 30, 2008 4:16 pm   
 
You actually can, but it's not recommended. You can use the syntax:

#VAR //windowname/varname value

to set the value of a variable in another window. This isn't recommended because it breaks the rules of privacy for data within windows, so creating a shared module to store your global variables is the correct solution as explained by the posters above.
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