Unknown Error #123 - Forum

Forum Navigation
You need to log in to create posts and topics.

Unknown Error #123

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

@rcohen

Good day! Try to isolate this issue and attach the PUB here. So that you can reproduce the error.

luishp, Gaev and rcohen have reacted to this post.
luishpGaevrcohen

@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.

Vadim, Darbdenral and rcohen have reacted to this post.
VadimDarbdenralrcohen

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...

 

 

 

@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.

 

luishp, Darbdenral and rcohen have reacted to this post.
luishpDarbdenralrcohen

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 !  ;=)

Darbdenral has reacted to this post.
Darbdenral

@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

 

 

Uploaded files:
  • You need to login to have access to uploads.
luishp, Vadim and rcohen have reacted to this post.
luishpVadimrcohen

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.

 

impactband4u has reacted to this post.
impactband4u