Page 2 of 2

Re: Refactoring

Posted: Sat Jan 12, 2019 8:38 pm
by Klaus
Try with "send":

Code: Select all

on openStack
   send "backSave" to me in 120
end openStack

Re: Refactoring

Posted: Sat Jan 12, 2019 9:26 pm
by richmond62
The initial script works NOW because I had OVERLOOKED
that you had called the folder "DWP autosaves" rather than "DWP autosave".

This saves backup stacks in the designated location but WITHOUT the "livecode" suffix.

So I changed the code:

Code: Select all

on openStack
   backSave
end openStack

on backSave
   save this stack as ("/Volumes/X1/DWP autosaves/SAVER" && the time && ".livecode")
   send "backSave" to me in 120
end backSave
Why one should have to add the suffix I am not sure.

Re: Refactoring

Posted: Sat Jan 12, 2019 9:42 pm
by jacque
Probably a path issue. Do this:

Code: Select all

answer folder "Choose a folder:"
put it
See if what you get matches what you typed into the handler.

Alternately, have you looked at the plug-in in the Development menu called "revSmartSave"? It does what you want.

Edit: never mind, I see you fixed it while I was typing. I still question that 2-second interval though.

Re: Refactoring

Posted: Sat Jan 12, 2019 10:03 pm
by Klaus
richmond62 wrote:
Sat Jan 12, 2019 9:26 pm
The initial script works NOW because I had OVERLOOKED
that you had called the folder "DWP autosaves" rather than "DWP autosave".
Well, I only copied YOUR script, see viewtopic.php?f=8&t=32003#p175220
So sorry! :D
richmond62 wrote:
Sat Jan 12, 2019 9:26 pm
Why one should have to add the suffix I am not sure.
You don't need a suffix actually, a valid stackfile is a valid stackfile, suffix or no suffix. So LC gives you the choice to leave the suffix out or add it (manually), isn't that a nice touch? :P

Re: Refactoring

Posted: Sun Jan 13, 2019 2:45 pm
by Lagi Pittas
I agree with Jacque about the interval but it is 120 milliseconds not 2 seconds -- whole lot of thrashing goin' on .....

Re: Refactoring

Posted: Sun Jan 13, 2019 2:51 pm
by Klaus
Lagi Pittas wrote:
Sun Jan 13, 2019 2:45 pm
I agree with Jacque about the interval but it is 120 milliseconds not 2 seconds -- whole lot of thrashing goin' on .....
If you omit the unit, LC presumes TICKS, so 120 in the script are in fact 2 seconds.
But even this interval does not leave much time for changes anyway. :D

Re: Refactoring

Posted: Mon Jan 14, 2019 12:27 pm
by Lagi Pittas
Well knock me down with a feather, thanks Klaus.

I ALWAYS assumed right at the start of my Livecode journey that it defaulted to milliseconds so I always put secconds or milliseconds on the end - so I never noticed.

How could I doubt Jacques' recollection of the Livecode basics......

Can we count in Jiffies as well?

Lagi

Re: Refactoring

Posted: Mon Jan 14, 2019 12:50 pm
by Klaus
What on earth are "Jiffies"? :shock:

Re: Refactoring

Posted: Mon Jan 14, 2019 1:17 pm
by bogs
Must be a time measurement, I've often heard that someone will "be there in a jiffy" :P

Re: Refactoring

Posted: Mon Jan 14, 2019 8:22 pm
by Lagi Pittas
I really thought that it was the invention of Commodore (CBM) for their PET computer but years later I found out from Wikipedia that Jiffies where a time measurement invented in the 1800s - and they are also used in the Linux kernal
The earliest technical usage for jiffy was defined by Gilbert Newton Lewis (1875–1946). He proposed a unit of time called the "jiffy" which was equal to the time it takes light to travel one centimeter in a vacuum (approximately 33.3564 picosec
But for our discussion
Early microcomputer systems such as the Commodore 64 and many game consoles (which use televisions as a display device) commonly synchronize the system interrupt timer with the vertical frequency of the local television standard, either 59.94 Hz with NTSC systems, or 50.0 Hz with most PAL systems. Jiffy values for various Linux versions and platforms have typically varied between about 1 ms and 10 ms, with 10 ms reported as an increasingly common standard in the Jargon File.[6]
Not many people know that
t - with apologies to Peter Sellers (and yes it wasn't Michael Caine - Not many people know that either .... ;-) )

http://www.todayifoundout.com/index.php ... t-of-time/

Lagi

Re: Refactoring

Posted: Mon Jan 14, 2019 8:46 pm
by Klaus
Ah, I see, thank you!
So no, we cannot count in Jiffies in LC, Lagi. :D

Re: Refactoring

Posted: Mon Jan 14, 2019 9:40 pm
by bogs
Well, we can count milliseconds, so in your own mind, you can substitute any ms value < 10 to be a jiffy. Myself, I'm going to call them 'snaps' :twisted:

Re: Refactoring

Posted: Tue Jan 15, 2019 6:22 pm
by mwieder
TIL - thanks for that. Although I admit to being partial to the quantum of time being the time required for light to travel the Planck length.