|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Nov 11, 2006 3:27 am
Question/Suggestion concerning multiple packages. |
Okay, so I've tested this using two different packages. Say I have a session loaded, with a main package named primary, and another package loaded called secondary, both of which contain modules that are published. If I create a variable in Primary, I can use it in scripts in secondary and even change its value using aliases from Secondary (Note: Is this the correct behaviour? This is happening even though neither module is enabled in the "list of enabled packages for this module"). But what happens if I have a third package with a third published module, Tertiary, which contains a variable of the same name? Which variable will the script in Secondary choose when pulling values and then when updating them? Is there any way to specify which the script chooses?
I only ask because this isn't documented at all that I could see. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 11, 2006 4:22 am |
You can specify the exact module using the syntax: @//modulename/classname/variablename
For example, if the variable is called "Hp" and it's in the main (top) class of the Primary module, the you can access it using #SHOW @//Primary/Hp. This syntax allows you to specific exactly which variable to use no matter what package it is in.
This syntax will eventually supported for aliases too, but I don't think it works yet. Also, the syntax @///varname can be used to retrieve a variable with the given name in the "current" window (the window with keyboard focus).
But you shouldn't be able to access variables without using this syntax if their "enabled" flag is turned off, so check that again, it might be a bug. But 1.13 had some problems saving the enabled packages list, so I'd test it again in 1.14. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Nov 11, 2006 4:35 am |
Ahh... I noticed that by default, the main window (the one specified using File Name in the Edit Session menu) has all the other packages enabled by default. That explains how I was able to refer to settings in one package without enabling it in the other. So no bug :)
|
|
|
|
|
|
|
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
|
|