RichardT Posted June 2, 2010 Posted June 2, 2010 All, I have a simple question (I think). I have a input field that captures a users input ($sInput). I want to make sure that the user inputs only numbers not letters. Here is my code: $pic = "c:\EngineConnect\TempBlank.bmp" SplashImageOn("Engine System", $pic, @DesktopWidth, @DesktopHeight, "", "", 1) $sInput = GUICtrlRead($sCapture) ;Checks to see if $sInput is a valid String IsString($sInput) $sX = StringFormat( "%.0d", 2 ) If $sX = @error =1 Then _FileWriteLog($sLogfile, "") _FileWriteLog($sLogfile, "Error - Engine Number Format is not Correct") SplashOff() MsgBox(0, "Error", "Engine Number Format is not Correct") GUICtrlSetState($sCapture, $GUI_FOCUS) EndIf I want it to return to the input field to try again (thus the GUICtrlSetState($sCapture, $GUI_FOCUS) but it doesn't do anything? Please help... RichardT "so much work, so little brains..."
Developers Jos Posted June 2, 2010 Developers Posted June 2, 2010 Why double/cross-post? Lets not. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
RichardT Posted June 2, 2010 Author Posted June 2, 2010 Sorry, I thought is was a seperate forum. I did the first for general help and the other for GUI. "so much work, so little brains..."
spudw2k Posted June 2, 2010 Posted June 2, 2010 Check out Regular Expressions too.Much more complicated, but much more powerful. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now