Chinasmoker 0 Posted February 3, 2007 (edited) CODE#include <GUIConstants.au3> $Form1 = GUICreate("测试", 483, 294, 192, 119) GUICtrlCreateLabel("测试", 16, 16, 28, 17) $no = GUICtrlCreateInput("", 112, 80, 121, 21) GUICtrlCreateLabel("号码", 48, 80, 28, 17) GUICtrlCreateLabel("密码", 48, 160, 28, 17) $pass = GUICtrlCreateInput("", 112, 152, 121, 21) GUISetState(@SW_SHOW) WinActive ("测试") WinWaitActive ("测试") GUISetState(@SW_SHOW) Select case $CMDline [1] > ("1.0e10") GUICtrlSetData (4,$CMDline[1]) Case $CMDline [1] < ("1.0e10") GUICtrlSetData (4,"") Case $CMDline [2] > ("1.0e10") GUICtrlSetData (7,$CMDline[2]) Case $CMDline [2] < ("1.0e10") GUICtrlSetData (7,"") EndSelect While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit I ve a question : if the numerical value of $CMDline is 1234567890 , how to judge digit of a number this script is used for input number of a credentials ,if it requires ten numeral ,in fact it is 987654321 (nine) ,then dont output ,how to judge digit of a number Maybe the words I talked is not clear,but I hope someone can undersatnd ,sorry ,my En is poor, Thanks any way Edited February 4, 2007 by Chinasmoker Hide Chinasmoker's signature Hide all signatures One is never too old to learn Share this post Link to post Share on other sites
SmOke_N 207 Posted February 3, 2007 (edited) If StringRegExp(GUICtrlRead($pass), '^\d{10}$') Then ;Do Something EndIf Edited February 3, 2007 by SmOke_N Hide SmOke_N's signature Hide all signatures Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
Chinasmoker 0 Posted February 4, 2007 If StringRegExp(GUICtrlRead($pass), '^\d{10}$') Then ;Do Something EndIf thanks,but can you depict easy ? Hide Chinasmoker's signature Hide all signatures One is never too old to learn Share this post Link to post Share on other sites
SmOke_N 207 Posted February 4, 2007 (edited) thanks,but can you depict easy ?It's a regular expression, the string it reads is the $pass input field, it verifies there only 10 digits, no less no more in the input field read. Edit: You could also set a min and max amount of characters allowed with GUICtrlSetLimit() and use $ES_NUMBER to make sure that it is only numbers being used:$pass = GUICtrlCreateInput("", 112, 152, 121, 21, $ES_NUMBER) GUICtrlSetLimit($pass, 10, 10) Edited February 4, 2007 by SmOke_N Hide SmOke_N's signature Hide all signatures Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
Chinasmoker 0 Posted February 5, 2007 It's a regular expression, the string it reads is the $pass input field, it verifies there only 10 digits, no less no more in the input field read. Edit: You could also set a min and max amount of characters allowed with GUICtrlSetLimit() and use $ES_NUMBER to make sure that it is only numbers being used:$pass = GUICtrlCreateInput("", 112, 152, 121, 21, $ES_NUMBER) GUICtrlSetLimit($pass, 10, 10)thank you very much Hide Chinasmoker's signature Hide all signatures One is never too old to learn Share this post Link to post Share on other sites