运行_max调用ini内的数据得到值为0
本帖最后由 zhusheng8701 于 2009-10-30 12:51 编辑#include <Math.au3>
Dim $n1=IniRead("1.ini","con","no1","")
Dim $n2=IniRead("1.ini","con","no2","")
Dim $n3=IniRead("1.ini","con","no3","")
Dim $m1=_Max($n1,$n2)
Dim $m2=_Max($m1,$n3)
MsgBox(0,"最大值",$m2)下面是1.ini内容
no1=1
no2=456
no3=23得到的值为0,请问是为什么呢?? 自己搞定、、、、
IniRead得到的内容为字符类型,强制转成数字类型就好了。#include <Math.au3>
Dim $n1=IniRead("1.ini","con","no1","")
Dim $n2=IniRead("1.ini","con","no2","")
Dim $n3=IniRead("1.ini","con","no3","")
Dim $m1=_Max(Number($n1),Number($n2))
Dim $m2=_Max($m1,Number($n3))
MsgBox(0,"最大值",$m2)
页:
[1]