Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.04.02;
Скачать: CL | DM;

Вниз

ListBox   Найти похожие ветки 

 
имя   (2006-03-21 18:30) [0]

Удалено модератором
Примечание: Ник смени


 
clickmaker ©   (2006-03-21 18:38) [1]


> Дидиюбище   (21.03.06 18:30)  
> Приветствую всех! Перейду сразу к делу

а чего так? Давай о жизни потрещим?


 
имя   (2006-03-21 18:47) [2]

Удалено модератором


 
Zeqfreed ©   (2006-03-21 18:48) [3]

procedure TForm1.Button1Click(Sender: TObject);
var
 i, n, sum : Integer;
begin
 Label1.Caption := "";
 sum := 0;

 for i := 0 to ListBox1.Items.Count - 1 do begin
  if not TryStrToInt(ListBox1.Items[i], n) then
   raise Exception.Create("failed");

  if (Label1.Caption = "") then
   Label1.Caption := "("
  else
   Label1.Caption := Label1.Caption + "+";

  Inc(sum, n);
  Label1.Caption := Label1.Caption + ListBox1.Items[i];
 end;

 Label1.Caption := Label1.Caption + Format(")/%d=%2.2f", [ListBox1.Items.Count, sum / ListBox1.Items.Count]);
end;


 
имя   (2006-03-21 19:03) [4]

Удалено модератором


 
Leonid Troyanovsky ©   (2006-03-21 19:24) [5]


> Блин, забыл сказать что ListBox могут быть дробные числа.


А больше ничего в оном ТЗ нет?
Может отнять, там, поделить.

RTFM: Val procedure.

--
Regards, LVT.



Страницы: 1 вся ветка

Текущий архив: 2006.04.02;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.076 c
1-1141332630
Gear
2006-03-02 23:50
2006.04.02
Блокирование запуска чужого приложения во время исполнения ...


3-1139309450
John_Doe
2006-02-07 13:50
2006.04.02
Referential Integrity,не пускает удалить.


15-1141722985
superoberon
2006-03-07 12:16
2006.04.02
Shelltreeview


2-1142507523
integery
2006-03-16 14:12
2006.04.02
знаки ???????????? вместо надписей


15-1141841936
QuasiLamo
2006-03-08 21:18
2006.04.02
runtime-редактор ресурсов