needs saving

Peter M. Brigham, MD pmbrig at gmail.com
Fri Nov 4 11:02:28 EDT 2011


Right. Then I have to figure out what to hash, which is do-able. But it doesn't answer the most important question: I need to trap a general message to trigger this so as to set the dirty flag on the window. I suppose the backup plan would be a send-in-time handler to check the hash periodically -- this means the hashing test would have to be very fast so as not to interrupt user input perceptibly. To be really complete, I'd probably want to get the hash of the whole stack, but I can't find a way to do that. The sha1digest() and md5digest() functions both expect a string input. I'd hate to have to script a concatenation of all fields and customprops, and I'd have to comb through a bunch of scripts to make sure that that would capture all the possible changes a user could make anyway. Even if I solve those problems, I'm still looking for a message to trigger the thing, though.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig

On Nov 4, 2011, at 10:16 AM, Mark Schonewille wrote:

> Hi Peter,
> 
> As soon as a field gets focused, revolution puts "edited" into gRevStackStatus[short name of this stack]. That's a very bad trick and means that your stack is almost always "edited".
> 
> A much better way is to calculate the hash of relevant data and compare this with a new hash value. If the two hash values are different, then you need to set the dirty flag.
> 
> --
> 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/16r Start selling Color Converter today. 20% commission!
> 
> On 4 nov 2011, at 15:04, Peter M. Brigham, MD wrote:
> 
>> Anyone know what the IDE uses to decide whether to ask about saving a stack when it closes? I'm trying to implement a "markDirty" routine for the Mac. I have a frontscript that catches (then passes) closefield and sets the modifiedMark of the stack, but that won't catch field contents modified by script, or changed customprops, etc, unless I comb through over 30,000 lines of code to find all the places where I change the contents of the stack, and insert a "markDirty" command. If I could intercept whatever message the IDE uses for this it would simplify things immensely.
>> 
>> -- Peter
>> 
>> Peter M. Brigham
>> pmbrig at gmail.com
>> http://home.comcast.net/~pmbrig
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list