Reliability of setProp/getProp
mike at doub.com
Sun Jan 15 08:01:58 CST 2012
I have a group "Pointer" that is made of 2 graphic objects. Within the script of group "Pointer", I have:
setprop thecolor newcolor
setprop finger newloc
I am not using them to set any persistent state but to control the color and location of the object itself.
When this behaviour starts, I am not able to set a breakpoints, but I can add put statements and that handlers are getting called, but NOT in the getProp/setProp handlers. This app has been working for sometime now until I started making changes in totally unrelated areas of the code. I have gone back to the original working version twice now, trying to carefully make changes and testing trying to isolate what introduces the problem.
I have also noticed that the debugger is off by several lines if you try single stepping. Can stacks get corrupted?
On 2012-01-15, at 8:26 AM, Mark Schonewille wrote:
> Hi Mike,
> Custom properties are very useful and reliable but will cause problems if:
> 1) you use them to save text to be displayed on multiple platforms
> 2) you want to save them as part of your standalone
> Solve (1) by storing text as unicode but keep in mind that this may still not work on PowerMacs. Solve (2) by using a separate stack to solve custom properties and store the stack in a preferences folder, program data folder or in the documents folder.
> You can't use names of built-in properties for your own custom properties.
> Which object is the target and where are your getProp/setProp handlers stored?
> If custom properties suddenly stop working or show unexpected behaviour, you probably have a mistake in your scripts. Custom propreties are very reliable.
> Best regards,
> Mark Schonewille
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> Become our partner in sales http://qery.us/1bq Start selling Color Converter today. 20% commission!
> On 15 jan 2012, at 14:11, Michael Doub wrote:
>> Are there conditions where getProp/setProp should not be used? have seen multiple instances where the setProp message does not seem to be recieved. What is even more strange is the fact that sometimes it works then for no reason it stops.
>> These constructs are much easer to use than sending messages to object, but they don't seem to be reliable. I am using 5.0.2.
>> Is anyone else experiencing this funny behaviour? Could I be doing something to stimulate it?
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode