Source language: Translate to:

Embedded Text Files

General questions about NeoBook

Moderator: Neosoft Support

Embedded Text Files

Postby StarterPack » Tue May 02, 2017 12:52 pm

Guys, Im missing something here.
When I'm still in my NB program and [Embedded] a Text File. I can read the [Embedded]Libraries.txt file into a ListBox.
But when I compile my program, I get an error message "Cannot open file *C:\embedded:\Libraries.txt. The filename, directory name, or volume label syntax is incorrect"

On Startup ( Page Enter ) I use: FileRead "[Embedded]Libraries.txt" "All" "[ListBox]"

Any Suggestions
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Embedded Text Files

Postby HPW » Tue May 02, 2017 2:44 pm

Hello,

Have you embed your Libraries.txt in Book\EmbedddFiles\ properly?
Does the file still in that path used in the embedd-dialog?

The global var [Embedded] translates to 'embedded:\\\' which tell neobook to read from internal file-System.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Embedded Text Files

Postby Gaev » Tue May 02, 2017 3:31 pm

But when I compile my program, I get an error message "Cannot open file *C:\embedded:\Libraries.txt. The filename, directory name, or volume label syntax is incorrect"

On Startup ( Page Enter ) I use: FileRead "[Embedded]Libraries.txt" "All" "[ListBox]"

Not clear if you get the error message at compile time ... or when you invoke your .exe file (and NeoBook tries to service the FileRead command).

Note that when you test your .pub (using F8, F9 or F10), Neobook does not bother embedding the files ... it uses the external file specified using menu Book >>> Embedded Files ...

Also not clear if your FileRead is in the Startup or PageEnter section of your pub ... note that when you test using F8 or F10, the Startup section code is NOT invoked ... so if it is in the Startup section, you need to test it with F9 to have the command invoked/serviced.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Embedded Text Files

Postby StarterPack » Tue May 02, 2017 10:42 pm

Hi HPW and Gaev

Thanks for the reply

Yes, I've Embedded the file in Book\Embedded Files\Libraries.txt properly and the error is not at compile time, but when i invoke (run) my .exe
Also I moved my FileRead "[Embedded]Libraries.txt" "All" "ListBox" from PageEnter to a button, but it still gives me the error when i press the button.

Also I just start a new pub, with a button and ListBox and [Embedded]Libraries.txt to test if it's something else in my program that prevent it to read into ListBox, but that also gives me the error. Can [Embedded].txt files been read into ListBox?

Maybe i must just extract the file first and then read from there.
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Embedded Text Files

Postby HPW » Tue May 02, 2017 11:22 pm

Hello,

Maybe this helps from the doc:

FileToVar
Purpose: Read the contents of a file into a variable. This is similar to using FileRead with the “All” option, but unlike FileRead, FileToVar can be used with Embedded files.


Regards
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: Embedded Text Files

Postby StarterPack » Wed May 03, 2017 7:17 am

HPW..... EXCELENT!!!

Thank You!
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest