Source language: Translate to:

FileRead odd behaviour....

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

FileRead odd behaviour....

Postby David de Argentina » Mon Jan 07, 2008 8:44 pm

Hi Dave,

I'm trying to read a text file called c:\file.txt

Try this:

FileRead "C:\file.txt" "All" "[text]"
and try to retreive [text] variable using a text object or input text object

I receive file not found in [PubDir] message error.

If you try:

SetVar "[file]" "C:\file.txt"
FileRead "[file]" "All" "[text]"

works fine.

sounds strange... isn't it?

Greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1562
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Jay-Bird » Mon Jan 07, 2008 9:55 pm

Does this help?


Code: Select all
FileRead "!C:\file.txt" "All" "[text]"


Try the exclamation with the above...
User avatar
Jay-Bird
 
Posts: 164
Joined: Fri Apr 01, 2005 7:01 am
Location: Louisiana , USA

Postby David de Argentina » Wed Jan 09, 2008 11:19 am

I know the ! clause works with numeric values.

But, I don't understand why i need to set the ! clause, if the first argument of FileRead action is a Literal....

Greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1562
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Neosoft Support » Wed Jan 09, 2008 11:28 am

Without the !, NeoBook wil localize the file name. NeoBook localizes the names of most files and external programs used within a publication. Localizing means that the drive and path are removed which is probably causing the problem. In many cases this is actually helpful when publications are distributed across multiple computers with different hard drive layouts. However, you can instruct NeoBook to leave the drive and path information intact by placing an exclamation point character ( ! ) at the beginning of the file name.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron