PDA

View Full Version : How to use text file as source for Listbox?



RichBPL
06-23-2021, 10:51 AM
How do I display lines from a text file as the source for a listbox wizard dialog?

I have a loop that reads the text file line-by-line, but I cannot find a way to concatenate the lines into something that works for the "List Box Text". All I get is a single item in the list. I have tried using the following when joining the lines back into a single string:
\n
|
<7ch>
\r
<13,10>


Rather than having to build a string, is there a way that I can just specify that the "List Box Text" should come from a data file?

RichBPL
06-24-2021, 10:26 AM
SOLVED:
This issues I had were:
1) dealing with three different notations for line endings: a) backslash-n, b) pipe, c) cr/lf and where each one should be used.
2) when and how to close a text file that is processed with any of the “Handle Text File Operation”,
3) setting file permissions on the text file after writing it to the Window’s “programData” subfolder.

RichBPL
06-24-2021, 10:30 AM
P.S.
When reading the lines of a text file with "Handle Text File Operation" and combining the lines into a string variable, the pipe symbol does work.
But one has to make sure the text file really has cr/lf as line terminators and not something else.