找回密码
 加入
搜索
查看: 1743|回复: 2

[AU3基础] 如何判断一组数字是否是纯数字(已解决)

[复制链接]
发表于 2010-4-21 18:26:52 | 显示全部楼层 |阅读模式
本帖最后由 lin0308 于 2010-4-21 19:20 编辑

比如 $au="1000",如何判断

谢谢各位
发表于 2010-4-21 18:34:50 | 显示全部楼层
函数参考
StringIsInt
--------------------------------------------------------------------------------

检查某个字符串是否整型数.


StringIsInt ( "字符串" )




参数

字符串 要检查的字符串.



返回值

成功: 返回值为 1.
失败: 返回值为 0,说明给定的字符串不是一个整数.



注意/说明

StringIsInt 对非字符串的整数表达式也返回 1.但是,如果是十六进制的表达式如 "4ff0" 等则 StringIsInt 的返回值为0.字符串中唯一允许含有的标点符号是在开头(首字符)的加号或减号.




相关

StringIsFloat, StringIsDigit, IsInt


示例/演示


StringIsInt("+42")  ;returns 1
StringIsInt("-00")  ;returns 1
StringIsInt("1.0")  ;returns 0 due to the decimal point
StringIsInt(1.0)    ;returns 1 due to number-string conversion
StringIsInt("1+2")  ;returns 0 due to plus sign
发表于 2010-4-21 18:35:27 | 显示全部楼层
If StringIsDigit ('1000') Then MsgBox(0, '', '字符串是纯数字')
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-3 08:29 , Processed in 0.073139 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表