Jump to content
Sign in to follow this  
RichardT

String Verify

Recommended Posts

RichardT

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

Share this post


Link to post
Share on other sites
RichardT

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

Share this post


Link to post
Share on other sites
spudw2k

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.