
Quote from rcohen on April 28, 2024, 1:31 amI'm referring to an embedded text file as [Embedded]file.txt
In design time (when I run it with F9) it runs fine and as expected. BUT as soon as I compile it and try to run it, I get the above error of "Unknown Error #123"
I'm sure it's how I'm accessing the embedded file but I can't remember how to fix it. I tried the ! in front of it as ![Embedded]file.txt but that didn't do it either.
Thanks for the help ;-0
rcohen
I'm referring to an embedded text file as [Embedded]file.txt
In design time (when I run it with F9) it runs fine and as expected. BUT as soon as I compile it and try to run it, I get the above error of "Unknown Error #123"
I'm sure it's how I'm accessing the embedded file but I can't remember how to fix it. I tried the ! in front of it as ![Embedded]file.txt but that didn't do it either.
Thanks for the help ;-0
rcohen

Quote from Vadim on April 28, 2024, 8:18 am@rcohen
Good day! Try to isolate this issue and attach the PUB here. So that you can reproduce the error.
Good day! Try to isolate this issue and attach the PUB here. So that you can reproduce the error.
Quote from Gaev on April 28, 2024, 3:06 pm@cohen:
In design time (when I run it with F9) it runs fine and as expected. BUT as soon as I compile it and try to run it, I get the above error of "Unknown Error #123"
I faintly recall a post in the old forum where Dave mentioned that embedded files are accessed from their original source locations during development testing (F8, F9 etc.) ... access such files from the space inside the .exe are only used after compilation.
Hence the discrepancy.
I'm sure it's how I'm accessing the embedded file but I can't remember how to fix it. I tried the ! in front of it as ![Embedded]file.txt but that didn't do it either.
I don't think the ! has anything to do with it (unless your file name has characters that can be interpreted as mathematical equations) ... more to do with how you specify embedding during the compile request.
You might try compiling with ...
- a different file name (preferably without any numeric/special characters)
- a different contentBest course of action is what @vadim has suggested.
@cohen:
In design time (when I run it with F9) it runs fine and as expected. BUT as soon as I compile it and try to run it, I get the above error of "Unknown Error #123"
I faintly recall a post in the old forum where Dave mentioned that embedded files are accessed from their original source locations during development testing (F8, F9 etc.) ... access such files from the space inside the .exe are only used after compilation.
Hence the discrepancy.
I'm sure it's how I'm accessing the embedded file but I can't remember how to fix it. I tried the ! in front of it as ![Embedded]file.txt but that didn't do it either.
I don't think the ! has anything to do with it (unless your file name has characters that can be interpreted as mathematical equations) ... more to do with how you specify embedding during the compile request.
You might try compiling with ...
- a different file name (preferably without any numeric/special characters)
- a different content
Best course of action is what @vadim has suggested.

Quote from rcohen on April 28, 2024, 7:32 pmI narrowed it down simply...
I put this into my page startup:
FileRead "![Embedded]array.txt" "[LineNumber]" "[TheLine]"and from runtime, as told, this works fine and it loads and I'm able to parse it, no issues.
BUT compile it and I get that error.
The file is simply named "array.txt" but is located in a folder (and drive) other than [PubDir]
I will likely give up trying to embed this file and go with another approach, but it sure would be nice to figure this out for next time...
Not real sure what the "use relative path and wildcards" setting is about in the packaging panel but I have tried it both ways to no avail...
Thanks all...
I narrowed it down simply...
I put this into my page startup:
FileRead "![Embedded]array.txt" "[LineNumber]" "[TheLine]"
and from runtime, as told, this works fine and it loads and I'm able to parse it, no issues.
BUT compile it and I get that error.
The file is simply named "array.txt" but is located in a folder (and drive) other than [PubDir]
I will likely give up trying to embed this file and go with another approach, but it sure would be nice to figure this out for next time...
Not real sure what the "use relative path and wildcards" setting is about in the packaging panel but I have tried it both ways to no avail...
Thanks all...

Quote from Vadim on April 28, 2024, 7:45 pm@rcohen
You need to extract the file first (ExtractFile command).
Unlike picture files (which can be displayed in the project without extracting them), text files must be extracted (e.g. to a folder for temporary files, using the [TempDir] variable) to be able to read lines from them.
An exclamation point in the path indication is not required.
You need to extract the file first (ExtractFile command).
Unlike picture files (which can be displayed in the project without extracting them), text files must be extracted (e.g. to a folder for temporary files, using the [TempDir] variable) to be able to read lines from them.
An exclamation point in the path indication is not required.

Quote from rcohen on April 29, 2024, 1:43 am20 years in Neo and I had NO CLUE about not being able to use txt files directly. I don't know how I missed that ;-0
Thanks @vadim!!
I'll get rid of the ! ;=)
20 years in Neo and I had NO CLUE about not being able to use txt files directly. I don't know how I missed that ;-0
Thanks @vadim!!
I'll get rid of the ! ;=)

Quote from impactband4u on April 29, 2024, 8:31 am@rcohen
I'm also not sure if i understand your question right, but you can read an [Embedded] TEXT file into ListBox and read lines from there. This will work after you compile. The problem is you cannot "save" to [Embedded] text files unless you extract them like Vadim said. But you already know that :) See example.
Greetings
Sorry, for it to work with the PUB you need to create a Test.txt file on your desktop or anywhere else and Embedded it into your pub.
Add all the months into Test.txt file
January
February
March
ect, ect
I'm also not sure if i understand your question right, but you can read an [Embedded] TEXT file into ListBox and read lines from there. This will work after you compile. The problem is you cannot "save" to [Embedded] text files unless you extract them like Vadim said. But you already know that :) See example.
Greetings
Sorry, for it to work with the PUB you need to create a Test.txt file on your desktop or anywhere else and Embedded it into your pub.
Add all the months into Test.txt file
January
February
March
ect, ect
Uploaded files:

Quote from rcohen on April 29, 2024, 10:22 pmHi @impactband4u,
Thanks for the pub demo... very helpful. I did manage to get this working but good to know I don't need to extract the file if I'm reading it into a Listbox.
I appreciate the time you took for this demo. Kudo's.
Hi @impactband4u,
Thanks for the pub demo... very helpful. I did manage to get this working but good to know I don't need to extract the file if I'm reading it into a Listbox.
I appreciate the time you took for this demo. Kudo's.