瑞文文摘
返回首页 | 手机用户请点此访问手机版
关键字:delphi自定义函数[过程] | 时间:2012/10/6

【delphi源码】取memo控件中一组数字的中位数的函数

delphi 取memo控件中一组数字的中位数的函数
function SortMemo(const m: TMemo):real;
var
N2:integer;
begin
with TStringList.Create do
begin
Sorted := True;
Text := m.Text;
m.Text := Text;
N2:=m.Lines.Count div 2;
If 2 * N2 = m.Lines.Count Then
SortMemo:=0.5 * (strtofloat(m.Lines.Strings[N2-1]) +strtofloat(m.Lines.Strings[N2]))
Else
SortMemo:=strtofloat(m.Lines.Strings[N2]);
Free;
end;
end;




上一篇:【教育文章】浅谈如何信息技术在小学数学教学的有效应用

下一篇:【六年级语文教案】跳水

Copyright © 瑞文软件工作室 冀ICP备17033643号 联系我们