Jump to content

Recommended Posts

Posted

How do I count the number of characters in a string?

what I want is

if 'string character count' > 10 then

msgbox(0, "", "NO")

or........

can I limit an input to a certain amount of characters? and limit the entry to numbers only?

Posted

How do I count the number of characters in a string?

what I want is

if 'string character count' > 10 then

msgbox(0, "", "NO")

or........

can I limit an input to a certain amount of characters? and limit the entry to numbers only?

StringLen()
  • Moderators
Posted

Damn Sean.. You are all over the place today... This is a good day to quit smoking for me (no need to try and help anyone!!) :P

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.

Posted

An example

$len = StringLen("How long am I?")
if $len > 10 Then
MsgBox(0, "", "NO")
EndIf


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

haha awesome...I knew I ive been looking at this too long...it was right in front of me

thanks!

Posted

IsNumber()

maybe this ... $ES_NUMBER

#include <GuiConstants.au3>

; GUI
GUICreate("MY GUI")
$Input_T = GUICtrlCreateInput("30", 50, 28, 40, 20, $ES_NUMBER)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    
    If $Msg = $GUI_EVENT_CLOSE Then Exit
    
WEnd

8)

NEWHeader1.png

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
×
×
  • Create New...