经过13楼建议,我作了一点修改,不过我还是认为dictionary比较方便,上次错误的主要原因是提取集合中的最大数的算法错误,现在已经改正,并且测试过了.
set fso=createobject("scripting.filesystemobject")
set op=fso.opentextfile("1.txt",1)
set d=createobject("scripting.dictionary")
i=1
do until op.atendofstream=true
ln=op.readline
t=mid(ln,17,3)
on error resume next
t=int(t)
if err=0 then
d.add i,t
end if
i=i+1
loop
mx=0
for each i in d
if d(i)>mx then
mx=d(i)
end if
next
if mx>45 and mx<90 then
msgbox("Temperature is OK"&chr(10)&"The hotest is "&mx&"C")
else
msgbox("Temperature is NG"&chr(10)&"The hotest is "&mx&"C")
end if
[ Last edited by zhoushijay on 2007-5-13 at 12:19 PM ]
你好,脚本专家!
<a target=blank href=tencent://message/?uin=29654761&Site=www.111.com&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=1:29654761:5 alt="点击这里给我发消息"></a>