Relaibly detecting a successful save in Windows
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Sun Jan 20 15:42:07 EST 2008
Hi Steve,
Unfortunately, I can't save over a network at the moment but I made
an experiment:
on mouseUp
local tStart
-----
put the milliseconds into tStart
save this stack as (the filename of this stack)
put the milliseconds - tStart
end mouseUp
I ran this test several times with a fresh new stack then adding some
large images to it:
Obviously, saving delay was completely related to the weight of the
stack:
5 ms for a blank stack until 100 ms after having added some large
images.
Conclusion: saving is blocking at least on the same machine.
Now over a network, I am not able to test at the moment :-(
Le 20 janv. 08 à 19:57, Stephen King a écrit :
> Hi Eric
>
> Yes I am aware of this and the first attempt had the test directly
> after the
> save. The delay was put in to see if this cured the problem.
> I think you missed the point though. The problem I have is that
> saving over
> a network can take some time, several seconds and it seems that Rev
> continues straight after the save command but the result is only
> updated
> with a fail if the save itself times out or hits some other
> problem. This
> can be several seconds later and until this time, the result is
> empty. By
> the time it comes back, Rev is well gone!
>
> I wonder.. not tried this but can the result be set by script
> before the
> save command , then Rev updates with either empty or unsuccessful
> at the end
> of the save. Won't work if Rev modifies the result when the save
> command is
> issued.
>
> Such as:
> Set the result to "saving"
> Save this stack
> Repeat until the result is not "Saving"
> End Repeat
> Test the result...
>
> Can't test this myself unfortunately as I'm not accessing the PC
> with Rev on
> it..
>
> Cheers
> Steve
>
>> In order to get a reliable value in the result function, the result
>> *must* be tested immediately after the command:
>>
>> save this stack
>> if the result <> empty then...
>>
>> No code between these two lines. Never.
>> If you need it, you may write:
>>
>> save this stack
>> put the result into tResult
>> <additional code>
>> if tResult <> empty then...
Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------
More information about the use-livecode
mailing list