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

Robert Brenstein rjb at robelko.com
Tue Jun 14 12:21:01 CDT 2005


>On 6/14/05 2:56 AM, "Robert Brenstein" <rjb at robelko.com> wrote:
>
>>  The Database_CreateCloseOpen stack says it will create a new database
>>  in the same folder as this project but creates it in the Revolution
>>  folder, one level higher.
>
>Yes I have see this also.
>
>Ivan, you need somehow obtain path to current stask
>
>     pathToDb = Path to stack & "dbname.vdb"
>
>This is not correct syntax, just an idea

When the example stack opens, it should get a path to its folder and 
save it in a custom property, so any example stack can fetch it and 
use as root folder. So all scripts in examples use only path relative 
to this.

for example

on openStack
   get the effective filename of this stack
   set the itemDel to slash
   set the rootFolderPath of this stack to (item 1 to -2 of it) & slash
   ...
end openStack

Then each time you need a full path

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

Robert


More information about the Valentina-beta mailing list