Page 1 of 1

Problem with Paths and Files

PostPosted: Thu Feb 07, 2002 3:17 pm
by Jim Brammer
If you're working with paths and files and it works in Pub mode but doesn't when compiled you might double check to see if you are using any hard-coded path statements to the files you are reading into your Pub. A full path statement, once compiled, is "localized". That is to say that the path is stripped down to just the filename. For example...

FileRead "C:\My Folder\anotherfolder\foo.txt" "1" "[Foo]"

will be compiled as...

FileRead "foo.txt" "1" "[Foo]"


If you need a hard-coded path to remain intact, an exclaimation character "!" must preceed the path statement like this...

FileRead "!C:\My Folder\anotherfolder\foo.txt" "1" "[Foo]"


Otherwise, a better approach might be to use variables to designate paths...

FileRead "[PubDir]anotherfolder\foo.txt" "1" "[Foo]"