Sign in to follow this  
Followers 0
Eli

number of characters in a string?

8 posts in this topic

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?

Share this post


Link to post
Share on other sites



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()

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

An example

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


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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

thanks!

Share this post


Link to post
Share on other sites

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

thanks!

glad to help

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

and limit the entry to numbers only?

IsNumber()

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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  
Followers 0