defaultfolder

David Burgun dburgun at dsl.pipex.com
Thu Apr 6 07:22:05 EDT 2006


Hi,

On 5 Apr 2006, at 16:10, Iden Rosenthal wrote:
>
> on setdefaultpath
>   put the filename of this stack into fullpath
>   set the itemDelimiter to "/"
>   put item 1 to (number of items in fullpath - 1) of fullpath & "/"  
> into SoulGuidingFolder
>   set the defaultfolder to SoulGuidingFolder
>   set the itemDelimiter to ","
> end setdefaultpath

I think a better way to do this would be to use a function, as so:

function setdefaultpath
local SoulGuidingFolder

	put the filename of this stack into fullpath
	set the itemDelimiter to "/"
	put item 1 to (number of items in fullpath - 1) of fullpath & "/"  
into SoulGuidingFolder

-- and easier way is to do:   put empty into item -1 of fullpath

	set the itemDelimiter to ","  --No need to do this, itemDelimiter is  
reset when you exit the function

	return SoulGuidingFolder
end setdefaultpath

Then when you use it:

set the defaultFolder to setdefaultpath()

This makes it more flexible and also allows you to "see" what is  
being set!

Hope this helps
Dave




More information about the use-livecode mailing list