Lazarus
Home
Forum
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Using the Lazarus IDE
»
General
»
TStringList.LoadFromFile
Downloads
Daily Snapshots
FAQ
Wiki
Bugtracker
IRC channel
Developer Blog
Follow us on Twitter
Mailing List
Free pascal
Other languages
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
About donations (wiki)
Bookstore
Lazarus, the complete guide
Search
Advanced search
« previous
next »
Print
Pages: [
1
]
Author
Topic: TStringList.LoadFromFile (Read 2653 times)
JLJR
Guest
TStringList.LoadFromFile
«
on:
July 16, 2005, 11:06:51 am »
Hi!. I'm trying what I think is a very simple thing, but it isn't works:
I have an TListBox into a form and, when I press a button is executed the next instruction:
listbox1.items.loadfromfile('c:\autoexec.bat');
It should display the lines of autoexec.bat into the listbox, but doesn't work, the listbox is empty.
Do you think there is a lazarus mistake or (is most possible) i'm doing something bad?
Thank you very much.
Logged
carbohydrate
New member
Posts: 8
TStringList.LoadFromFile
«
Reply #1 on:
July 16, 2005, 12:31:45 pm »
I'm using Lazarus 0.9.8 and FreePascal 2.0 and it's working with the source code you have given:
procedure TForm1.Button1Click(Sender: TObject);
begin
listbox1.items.loadfromfile('c:\autoexec.bat');
end;
Logged
Anonymous
Guest
TStringList.LoadFromFile
«
Reply #2 on:
July 16, 2005, 06:54:16 pm »
Thanks a lot.
I found the problem. My text file was saved as UNICODE instead of ANSI. It seems that LoadFromFile doesn't work fine with UNICOD files.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Using the Lazarus IDE
»
General
»
TStringList.LoadFromFile
Recent
Q about capabilities of t...
by
mdlueck
[
Today
at 06:30:59 pm]
Cross Compile
by
Leledumbo
[
Today
at 05:23:05 pm]
TaChart ternary plot func...
by
wp
[
Today
at 05:08:44 pm]
Stable database?
by
BigChimp
[
Today
at 03:27:28 pm]
Lazarus 0.9.30.4 released
by
felipemdc
[
Today
at 03:08:45 pm]
Colored cells of a string...
by
paskal
[
Today
at 02:34:31 pm]
writeln fails to output t...
by
jack616
[
Today
at 02:18:10 pm]
[SOLVED] How to install l...
by
HexNihilo
[
Today
at 01:24:54 pm]
libUSB under win32
by
helloa
[
Today
at 01:20:01 pm]
[SOLVED] How to make a pu...
by
paskal
[
Today
at 01:14:38 pm]