Jump to content

Recommended Posts

Posted

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..."

Posted

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..."

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...