Листинг подпрограмм
procedure Tform1.FormCreate(Sender: Tobject); Begin Edit1.Text:= ‘’; Edit2.Text:= ‘’; Edit3.Text:= ‘’; end;
procedure Tform1.Button1Click(Sender: Tobject); Begin Edit1.Text:= ‘’; Edit2.Text:= ‘’; Edit3.Text:= ‘’; end;
procedure Tform1.Button2Click(Sender: Tobject); Begin close; end;
procedure Tform1.Button3Click(Sender: Tobject); Begin s:=Edit1.Text; s:= concat (s, #32); i:= 0; while Length (s) > 0 do Begin i:= i+1; p:= pos (#32,s); ss:= copy (s,1,p-1); Val (ss,k,code); a[i]:= k; delete (s,1,p); end; max:= a[1]; For j:= 1 to i do if max < a[j] then max:= a[j]; min:= a[1]; For j:= 1 to i do if min > a[j] then min:= a[j]; Edit3.Text:= IntToStr (max); Edit2.Text:= IntToStr (min); end;
|