Page 1 of 1
Windows Execution Error
Posted: Sat Sep 24, 2011 5:36 pm
by Pebah
I have a strange bug happening in Windows, but not in OS X
When I send a message to a particular background from a card button, in Windows I get an "Execution Error."
In OS X, no problems.
I've tried various testing scenarios to narrow down the problem.
This works, and outputs "there is a background ID 4782":
on mouseUp
if there is a background ID 4782 then
put "there is a background ID 4782" into field "Field"
end if
end mouseUp
put doing:
send "foo" to background ID 4782
brings up the error dialog, even though there is a foo handler in that background script.
Messages to other objects on the card seem fine. This is the main background in the stack with 400+ cards and several card objects on each card. It is a conversion from a HyperCard stack of long ago.
Any suggestions?
Re: Windows Execution Error
Posted: Sat Sep 24, 2011 6:13 pm
by WaltBrown
I don't have an answer, but on which machine did you convert it from the old HC stack? This doesn't answer it, but appears to have some implications (from the Dictionary):
Important! If a stack was originally created with HyperCard and then imported into LiveCode, the ID of each control in the stack is guaranteed unique only within its domain. (You can check a stack's HCStack property to determine whether it began life in HyperCard. )
Note: If a stack's HCAddressing property is set to true, the long or abbreviated ID of a control in that stack begins with the word "background" if the control is part of a group, and with the word "card" if not.
If, say, it was originally converted on a Mac, then the resulting LC stack moved over to a PC, maybe something invisible and automagical happens. The dictionary entry implies that. Since "background" is a synonym for "group", is it possible that it would have been changed to "card" instead?
Just throwing out a possible avenue of investigation. Good luck.
Re: Windows Execution Error
Posted: Sat Sep 24, 2011 6:44 pm
by Pebah
Yes, it was converted on a Mac.
I thing you're right, that something in the conversion has, well, disabled some functionality.
I'm thinking of now creating a new stack and moving all the data over...
Re: Windows Execution Error
Posted: Sun Sep 25, 2011 1:11 am
by Pebah
Found the problem.
I made a new stack and copied some things over and got the same error.
So it made me think that there was something wrong with the particular background script itself. Sure enough, funny characters in the script that work on a Mac, but don't translate to PC.
The characters that are made on the Mac using the option key, equivalents of: not equal (equal sign with a slash through it), >=, etc. Even though the LiveCode users guide lists these exact characters I was using as legal operators, they don't seem to translate over as part of scripts.
Re: Windows Execution Error
Posted: Sun Sep 25, 2011 4:06 am
by jacque
RIght. The not-equals sign is Mac-only. When LiveCode imports a HyperCard stack it usually converts all the not-equals signs to "<>" automatically. If that didn't happen, all I can think of is that maybe you pasted the script into the background group instead.
The original IDs should work. A converted HC stack actually creates two IDs for each object: the orginal HC ID (known now as the "altID") and its own, native ID. You can refer to an object using either ID.