Jump to content

A Question About String's


Synth
 Share

Recommended Posts

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
Link to comment
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


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

Link to comment
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

Link to comment
Share on other sites

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]

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

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