I have a tmemo which I will populate with the folloing kind of data...
3 9.037802778 7.285102778 1158 11630 40 -2.000 ABC ENRT DN ABUJA VOR/DME
12 9.037802778 7.285102778 1158 11630 40 0.000 ABC ENRT DN ABUJA VOR/DME
3 11.549211111 43.154819444 49 11460 40 2.000 ABI ENRT HD DJIBOUTI TACAN
12 11.549211111 43.154819444 49 11460 40 0.000 ABI ENRT HD DJIBOUTI TACAN DME
3 32.462833333 13.169508333 489 11510 130 2.000 ABU ENRT HL ABU ARGUB VOR/DME
12 32.462833333 13.169508333 489 11510 130 0.000 ABU ENRT HL ABU ARGUB VOR/DME
3 -28.570652778 16.533833333 98 11210 130 -19.000 ABV ENRT FA ALEXANDER BAY VOR/DME
12 -28.570652778 16.533833333 98 11210 130 0.000 ABV ENRT FA ALEXANDER BAY VOR/DME
I've been playing arund with a for to do loop to iterate through the tmemo data, line by line, but keep getting errors.
I've been trying to use strutils delspace1 and trim.
Here is the code from my last attempt...
procedure TForm5.Button12Click(Sender: TObject); //del all but one spaces
var
S: String;
lineno: integer;
begin
lineno := 1;
For memo1.lines[lineno] := 1 to memo1.lines[lastindex] do
begin
S := memo1.lines[lineno];
DelSpace1 (S);
memo1.lines[lineno] := S;
//lineno = lineno + 1;
end;
end;
Questions:
1. How do I iterate the lines? I get an erro using memo1.lines[lastindex]
2. not sure how to use the strutils routines in the graphical environment.
thx in adv