GLX2 Tools for Development

Replies to This Discussion

Hi Jerry.

I just wanted to report an interesting thing I have noticed on several occasions and have seen and proven to myself just now.

I have several cards, each with some scripts with identical names. I am doing this because I want each card to operate identically (each represents a table in the SQL database) but with local variables specific to each card. So the scripts have to be running local to the cards, and they are called with buttons common to every card as background controls.

If I am on one of these cards and I use the VAB to go to another card other than the one I am editing, the version of the script that gets run is the one I viewed in the VAB, and NOT the one on the card I am actually on. Closing the VAB does not change this. From then on I will always run the script from the other card. I know this because the values for the local variables have not been initialized so I start throwing errors when I use a local variable, and GLX2 pops open the script for the card. It is not the card that my application window has open.

Now I know what you are going to say. "Don't do that!" And I would wholeheartedly agree. It's not smart to have identically named functions on different cards, but it solves a sticky issue for me, namely how to get cards to act like seperate instances of a table browser by utilizing script local variables. But that is not important now. What is important is that it may explain some of the bugs people have reported when using GLX2 and VAB together.

It is easily repeatable.
Create a stack with 2 cards
Make an Opencard handler that uses a script local variable
Have the Opencard handler put something into the script local variable
Paste that script into both card scripts. (compile of course)
Go to the first card, which should put something into the script local variable for that card
Use the VAB to navigate to the second card
Close VAB
Run the Opencard script again (without navigating to another card that would spoil the experiment)
Check the value of the script local variable

My guess is the variable will be empty and "get the short name of this card" will return the name of the second card and not the first. I am guessing that VAB pulls some fancy tricks to open the card without launching the scripts therein, but is not resetting the focus back to the stack's card when it closes.

I can work around this so I am not asking for a solution. I am hoping that I might have found the cause for others (and my own) woes when using VAB, which by the way is IMHO a really cool way to edit stacks.

Reply to This

RSS

© 2009   Created by Daniels & Mara on Ning.   Create Your Own Social Network

Badges  |  Report an Issue  |  Privacy  |  Terms of Service