Source language: Translate to:

Problem with Paths and Files

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Problem with Paths and Files

Postby Jim Brammer » Thu Feb 07, 2002 3:17 pm

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]"
Jim Brammer

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 1 guest