Sign in to follow this  
Followers 0
Synth

A Question About String's

10 posts in this topic

#1 ·  Posted (edited)

When I type a sentence into InputBox with the String "(Lol)" . It doesnt find it.

Is there any way to fix this? <_<

CODE
$b = InputBox("This" ,"Doesn't work" ,"","")

If $b == "(Lol)" Then

MsgBox(0,"It works","but,it doesnt")

EndIf

Edited by Synth

Share this post


Link to post
Share on other sites



Lose the brackets

$b = InputBox("This" ,"Doesn't work" ,"","")

If $b == "Lol" Then
MsgBox(0,"It works","but,it doesnt")
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

With the thing that Im doing i need the brackets.

And I tried it,it doesn't work..

Share this post


Link to post
Share on other sites

With the thing that Im doing i need the brackets.

And I tried it,it doesn't work..

I don't understand what the problem is. I just ran the code you posted and it worked fine for me.

I typed "(Lol)" without the quotes and $b was returned with exactly that and the message box displayed.

Have I misunderstood something here?


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You are aware that

$b == "(Lol)"

is case sensitive.

$b = "(Lol)"

is case insensitive

Your example fails if you enter "(lol)".

Edited by picaxe

Share this post


Link to post
Share on other sites

I mean't when i type a sentence (ie: "This makes me go (Lol)" without the quotes ) it doesn't return the message box. But if i just type "(Lol)" It does.

picaxe > Im aware of that.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Nope that doesn't work for me...

I already made it case sensitive,but that's not what i want.

Ps: Look at the 6# post.

Edited by Synth

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Try this.

$Input = InputBox("This" ,"Doesn't work" ,"","")


$b = StringInStr($Input, "(Lol)", 1); '1' makes it case sensitive.

If $b > 0 Then
MsgBox(0,"It works","but,it doesnt")
EndIf

I made a mistake I believe. Give that a shot.

Edited by Sardith

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites

Hi,

If StringInStr(InputBox("This", "Doesn't work", ""), "(Lol)", 1) Then MsgBox(0, "It works", "Works")

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Thanks Xenobiologist, It works <_<

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