A real stinker

Bob Sneidar bobsneidar at iotecdigital.com
Thu May 12 17:32:45 EDT 2016


Hi all. Here's a real stinker:

I have a main card, and a Database Setup card. I have a function handler in the Database Setup card called getConnection(). All this function does is populate an array with the state and contents of certain fields and buttons on the Database Setup card and return the array. 

Now in 6.7 the current card can be any card in the stack and the function works as expected. In version 8 however it *ONY* works if the current card is the Database Setup card! 

Here's an example of a command in that function:
put the hilited of button "btndbPrimary" of me into aConnection ["enabled"]

This button is a checkbox which is hilited if I am currently connected to a database. If I am using version 8, and the current card is NOT Database Setup, it will return false, and field values will return empty. 

Now I have tried to create a new simple stack to demonstrate this, but it works in the new stack. But a project I developed in 6 and opened in 8 (I assume there is a conversion going on there) it does not work correctly. 

Now here is a twist. If I first use the command:
put the long name of me into tThisCardID

and then substitute *me* with tThisCardID like so:
put the hilite of button "btndbPrimary" of tThisCardID into aConnection ["enabled"]

THAT WORKS!! It seems that *me* is only referring to the correct card if it is the current card in my project, and only in version 8 and only with converted stacks. 

I can probably fix this by replacing every instance of *me* with the long name of the card or object it is referring to, but that will be a helluvalotta work. I'd rather figure out what is going on here. I wouldn't mind sending a copy of the stack to someone at RunRev, but because this stack access company data that I cannot generally divulge to others, I would have to connect to some dummy data for you to see what it is doing. 

Bob S



More information about the Use-livecode mailing list