[V4REV] Notes on example stack // path to stack folder

Robert Brenstein rjb at robelko.com
Tue Jun 14 16:18:36 CDT 2005


>Is it another way to set default application folder?
>Something like:
>
>set defaultfolder to rootFolderPath
>..
>
>After this all relation path must be treated as related to rootFolderPath.
>
>
>--
>Best regards,
>  Ivan                            mailto:IvanSmahin at public.kherson.ua


Unfortunately, the defaultFolder is a bit of a misnomer. It does not 
set the default folder but the current folder. You would use the 
defaultFolder, for example, to fetch a list of files from a specific 
directory:

set the defaultFolder to someFolderPath
get the files

The setting is not permanent and can, and usually will, change during 
execution (it would not change if you were executing as a standalone, 
but you are executing in a multi-application environment). The 
approach I suggested is safer.

If you do not want to keep typing the full reference to the custom 
property, add a function to your mainstack that gives it to you; for 
example:

function ExFullPath relPath
    return (the rootFolderPath of stack "exampleIndex") & relPath
end ExFullPath

then instead of

put (the rootFolderPath of stack "exampleIndex") & relDbPath into fullDbPath

you can use

put ExFullPath(relDbPath) into fullDbPath

Robert


More information about the Valentina-beta mailing list