attention tu n'emplois pas la bonne methode pour la creation et liberation des objets :
with TStringList.Create
dotry Delimiter :=
',';
DelimitedText := edit1.text;
//verifie se qu'il y a dans le Tedit... label1.Caption := (IntToStr(Count));
//compte combien il y a de virgule....
finally Free;
//je libére tout sa...end;pour compter la presence d'un caractere dans une chaine tu peux egalement faire :
function CountChar(const S : string; const C: char) : integer;
var N, P : integer;
begin
result := 0;
for N := P to Length(S) do
if S[N] = C then
inc(result);
end;
a utiliser comme suis :
V := CountChar(Edit1.Text, ',');
Label1.Caption := IntToStr(V);