Page 1 of 1

Populate List Box from text file

Posted: Mon Jan 30, 2017 10:15 am
by tfosorcim
Howdy,

I am trying to add a listbox containing the IP Addresses for a particular system, and wrote a script to generate the IP Addresses.

My installer code runs the script and then reads text file output to a variable, to get the IP Addresses into the listbox.

For some reason, the listbox is only seeing the first entry when I write it to a variable and read it from the MessageBox and the Listbox item list...

Any ideas?

The text file is attached (unaltered) from my testing system as well as a screenshot of my installer code.

Steven

Re: Populate List Box from text file

Posted: Mon Jan 30, 2017 2:57 pm
by FrancescoT
Dear Steven,

for what I see your TXT file uses ANSI format, while recent InstallAware versions support UNICODE only.

I suggest you to try with storing your TXT as UNICODE ... this should solve the issue.

Hope this helps you.

Regards

Re: Populate List Box from text file

Posted: Mon Jan 30, 2017 7:08 pm
by tfosorcim
Howdy,

I have tried Unicode file formatting, and not had any better luck...

Here's a screenshot of a test Project with Both Ansi and Unicode files...

I would have thought the Unicode File would have looked better... but apparently not..

Something else must be wrong as well.. also?

I am writing a /r/n at the end of the lines.. Is that incorrect as well? I tried with just with a /n only and that didnt seem to help either.

Steven

Re: Populate List Box from text file

Posted: Mon Jan 30, 2017 7:14 pm
by tfosorcim
P.S. Just read this from the help file.... for "Read From Text FIle"

This command helps you read a single line of text from a text file. Unicode files are not supported.

Re: Populate List Box from text file

Posted: Mon Jan 30, 2017 7:22 pm
by tfosorcim
and 2 more points are awarded to the help file.... when I finally "read it all"

.....Prefix the path specified in the Read from File field using the special sequence #READALL\ if you wish to read in the entire file, instead of just the first line of the file. Lines in entire files read this way will be separated using the $NEWLINE$ variable.

Probelm solved. Thank you for your responses to my "noob"-iness

Steven

Re: Populate List Box from text file

Posted: Wed Feb 01, 2017 6:51 am
by FrancescoT
Happy you solved!

Regards