The standalone and the IDE - a cautionary tale
richmondmathewson at gmail.com
Thu Oct 31 12:59:04 EDT 2013
On 10/31/2013 06:52 PM, Graham Samuel wrote:
> RunRev have just kindly helped me to solve an issue which I had reported as a bug (number 11183 as it happens) - I have also tried to ask for help from this list from time to time. It turned out to be my error, kind of, but it revealed a difference between running a Livecode program in the IDE and in a standalone, which may be of more general interest.
> Part of my program allowed vector drawing by allowing the user to pick one of the standard graphic tools (rectangle, line, oval, polygon etc) and then to draw on a card. This worked in the IDE, but in the standalone weird stuff happened: for example on clicking with the mouse after a tool selection, a minimum size graphic was created, but the subsequent drag of the mouse while down, in order to establish the size and shape of the graphic, simply didn't work at all. There were other issues to do with the pointer tool, where selection seemed to be impossible using the tool, although it was fine when done by script.
> What RunRev were able to show me was that I had a bit of code which detected mouseDown messages in order to see if they could be interpreted as a request for context menu. If the answer was 'no', of course I should have passed the mouseDown, but my script was wrong and I had left this 'pass' statement out. This caused the bad behaviour that I was seeing. However there were a number of oddities about this error: firstly, somehow the IDE got hold of the mouseDown itself and didn't rely on my code passing it on, so the program worked in that context; and secondly, my 'bad' code was situated in the stack script, whereas the drawing takes place on a card belonging to the stack. In my mind, this second fact is confusing, since I imagined that the card would receive the mouseDown first, thus allowing drawing to happen, and any mouseDowns detected by the stack would be there because the card had passed them on or ignored them. So although I had made a coding error, it was (and is) hard for me to see why it affected the drawing actions, which all took place on the card.
> I think RR have taken this on board and eventually the difference between the IDE and the standalone will be ironed out - though probably not with a very high priority. Meanwhile I thought I should warn other developers about this strange difference, which made my coding mistake virtually undetectable.
And the moral of your cautionary tale is to make sure you do lots of
rigorous Beta testing of the standalones.
My Devawriter fell foul of this quite a few times; mainly because I,
being naive, relied on external Beta testers (i.e. not me) who did not
know what functionality I had in the original stacks; so they didn't
know what to expect, and what to test for.
I suppose one of the ways round this is to write incredibly detailed
instructions for your Beta testers; but the time spent writing those
instructions could just as well be spent doing your own testing.
I have slowed down the rate I pump out new versions and am spending
loads of time doing tedious stuff with standalones on the Operating
Systems I am targetting so that the new versions, although less
a chance of being less buggy.
More information about the Use-livecode