Saving snapshots to files

Wilhelm Sanke sanke at hrz.uni-kassel.de
Fri Mar 12 10:19:01 EST 2004


On Fri, 12 Mar 2004, Robert Brenstein <rjb at rz.uni-potsdam.de> wrote:

(snip)
 >>This smells like "basename" and "dirname" to me. Aren't these

> >>standard function available in Revolution?
>
> Nop, no such functions. But these values are so trivial to extract
> that no special functions are needed. Instead of locating the
> LastSlash (which presumably was done walking down chars from the end
> or using offset in a loop), it is simpler to
>
> set the itemDelimiter to slash
> put last item of LongDateiName into Dateiname
> put item 1 to -2 of LongDateiName into NewDirectory
>
> and if LongDateiName is fetched using sth line
>
> put the long name of this stack into LongDateiName
>
> and then cleaning the it from extra word and quotes, the same can be
> done with a single line


You are completely right, of course! I have used the changing of the 
itemdelimiter on other occasions.
My (rather old) script was one of the first tries to deal with the 
return value of the "ask file" command - and as the solution worked fine 
this button somehow was transferred to other stacks and never updated.

Ken mentioned in the meantime that there is no entry "export snapshot" 
in the documentation; there is none in Metacard, but in the Transcript 
Dictionary  of Rev.

Regards,

Wilhelm Sanke



More information about the use-livecode mailing list