Topic: READING AN EXTERNAL TXT FILE
Hi
I need to read an external txt file to make decissions in VD .
How can it be done ?
Thanks
Elico
My Visual Database → General → READING AN EXTERNAL TXT FILE
Hi
I need to read an external txt file to make decissions in VD .
How can it be done ?
Thanks
Elico
Hello,
example:
procedure Form1_Button2_OnClick (Sender: string; var Cancel: boolean);
var
sl: TStringList;
begin
sl := TStringList.Create;
sl.LoadFromFile ('c:\readme.txt');
ShowMessage(sl.Text);
sl.Free;
end;
I need this task to be done in a constant loop .
I need to read a line by line from the text file .
In each line in the txt file will be written a name of an image.
Each image will be shown in a image component .
How this may be done ?
Thanks
Eliko
procedure Form1_Button2_OnClick (Sender: string; var Cancel: boolean);
var
sl: TStringList;
i,c: integer;
begin
sl := TStringList.Create;
sl.LoadFromFile ('c:\readme.txt');
c := sl.Count - 1;
for i := 0 to c do
begin
if i = 0 then Form1.Image1.Picture.LoadFromFile(sl[i]);
if i = 1 then Form1.Image2.Picture.LoadFromFile(sl[i]);
if i = 2 then Form1.Image3.Picture.LoadFromFile(sl[i]);
if i = 3 then Form1.Image4.Picture.LoadFromFile(sl[i]);
end;
sl.Free;
end;
Thanks
Elico
My Visual Database → General → READING AN EXTERNAL TXT FILE
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi