Author: William Gerbert Count words in a memo Answer: Insert 1 label, 1 button and 1 memo. 1 2 procedure TForm1.Button1Click(Sender: TObject); 3 4 function Palabras(Link: string): integer; 5 var 6 n: integer; 7 befspace: boolean; 8 begin 9 befspace := FALSE; 10 if Link = '' then 11 Result := 0 12 else 13 Result := 1; 14 for n := 1 to Length(Link) do 15 begin 16 if befspace and 17 (Link[n] <> ' ') and 18 (Link[n] <> #13) and 19 (Link[n] <> #10) then 20 Inc(Result); 21 22 befspace := (Link[n] = ' ') or 23 (Link[n] = #13) or 24 (Link[n] = #10); 25 end; 26 end; 27 28 begin 29 Label1.caption := IntToStr(Palabras(Memo1.Text)); 30 end; 31 end;