When Export Snapshot doesn't work

Graham Samuel livfoss at mac.com
Thu Apr 14 13:32:41 EDT 2011


Mark, thanks for staying with me. I don't suggest that LC should actually send out messages to a user when a file operation fails, but I could not detect that 'it' or 'the result' had been set when things went wrong - the LC documentation is very incomplete in this respect. I am happy to write my own code to test if the file exists already, but I had not expected to check if the file had been created, since if it hasn't this suggests some kind of system failure like wrong permissions or even physical disk errors, and if anything like that is happening I would want to be able to know more than just "file was not created". I have a Blu-ray player that sometimes says "this disc cannot be played" when you insert a movie - drives me crazy, I want to know what went wrong!

As to the checking that the user has selected a valid area to snapshot, I do that - I was just curious that again the docs don't tell you that a partial snapshot will fail. I made a lot of snapshots during debugging and they never showed up because of mistakes in my coding. If I'd seen that bit of info in the docs I would have been forewarned. I will try to add a comment to the 'snapshot' entry when I have a moment.

Cheers

Graham

On Thu, 14 Apr 2011 11:16:57 +0200, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:
> 
> 
> Hi Graham,
> 
> You can write your own code to make sure that a file doesn't exist already. Before you export a snapshot to it, you can delete the file and check that it has been created again afterwards. You can also check "the result" and "it" for errors at certain points.  I wouldn't want RunRev to show some error message by itself. I prefer to have full control over error messages and I don't think that the current ways of (silent) error reporting should be changed.
> 
> You can write a script to check that the user selected an area within the target rect. If not, don't apologise for the user's mistakes but just show your custom error message.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce
> 
> On 14 apr 2011, at 10:31, Graham Samuel wrote:
> 
>> Mark, thanks for the reply, but I'm amazed that you are happy with the idea of silent failure of **any** operation. 
>> 
>> The thing is, I'm using 'snapshot' to create the output of my app (it's a portion of a bitmap that's been chosen by my user, to simplify somewhat). If nothing appears, then I need at least to make my excuses to the user and asking him/her to try again. As it is, to detect that the operation has failed means means more code. Maybe I should be using 'crop' followed by some separate file-exporting operation: then at least I'd know by conventional means if the file couldn't be written. In general, I don't yet understand how one detects failures of operations based on URLs. But I'm a newbie in this respect.
>> 
>> Graham
> 



More information about the use-livecode mailing list