|
deathkitty Apprentice
Joined: 14 Apr 2008 Posts: 105
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
deathkitty Apprentice
Joined: 14 Apr 2008 Posts: 105
|
Posted: 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?
|
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Apr 30, 2008 1:53 pm |
You can also use the #module command but the GUI is easier.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
|
|