Me parece que le estamos liando más que ayudando. ¿Que tal algo más simplificado en el evento OnClick del Button1?
Código Delphi
[-]
Procedure Form1.Button1.OnClick(Sender: TObject);
var
nota1, nota2, nota3, nota4, nota5, nota6: Integer;
NumeroDeExamenes : Integer;
NotaPromedio : Double;
begin
If Edit1.Text <> '' then begin
NumeroDeExamenes := NumeroDeExamenes +1; Nota1 := StrToint(Edit1.Text); end;
If Edit2.Text <> '' then
begin
NumeroDeExamenes := NumeroDeExamenes +1;
Nota2 := StrToint(Edit2.Text);
end;
If Edit3.Text <> '' then
begin
NumeroDeExamenes := NumeroDeExamenes +1;
Nota3 := StrToint(Edit3.Text);
end;
If Edit4.Text <> '' then
begin
NumeroDeExamenes := NumeroDeExamenes +1;
Nota4 := StrToint(Edit4.Text);
end;
If Edit5.Text <> '' then
begin
NumeroDeExamenes := NumeroDeExamenes +1;
Nota5 := StrToint(Edit5.Text);
end;
If Edit6.Text <> '' then
begin
NumeroDeExamenes := NumeroDeExamenes +1;
Nota6 := StrToint(Edit6.Text);
end;
NotaPromedio := (Nota1 + Nota2 + Nota3 + Nota4 + Nota5 + Nota6) / NumeroDeExamenes
ShowMessage(FormatFloat('#0.0', NotaPromedio));
end;
De esta forma puedes sacar el promedio de los 6 examenes, de 3, ó de 5 si te da la gana, solo tiene en cuenta aquellos que tienen algo escrito