Valhalla Legends Forums Archive | Visual Basic Programming | [VB6] Google search

AuthorMessageTime
Topaz
I'm implementing a command in a chatbot which will open the user's browser and send the search query to Google.

I'm not sure why, but this isn't working:

If txtSend.text = Mid("/google", 9) Then
googlesearch = Mid(txtSend.text, 9)
ShellExecuteA Me.hWnd, "Open", "http://www.google.com/search?q=" & googlesearch & "&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official", 0&, 0&, 0&
Exit Sub
End If

I believe its to do with the fact that it's only being read after KeyPress, and at that point txtSend.Text is cleared.
August 4, 2005, 5:02 PM
Stealth
[quote author=Topaz link=topic=12433.msg123049#msg123049 date=1123174974]
If txtSend.text = Mid("/google", 9) Then[/quote]

At first glance, this line is at fault. Your code is somewhat backwards. :)
August 4, 2005, 5:10 PM
Topaz
Yeah, I just noticed my error:

If Left(txtSend.Text, 9) = "/google " Then
August 4, 2005, 5:11 PM
dRAgoN
[quote author=Topaz link=topic=12433.msg123053#msg123053 date=1123175505]
Yeah, I just noticed my error:

If Left(txtSend.Text, 9) = "/google " Then
[/quote]

Shoulden't that be left(text, 8 )

edit: damned smilys
August 4, 2005, 7:03 PM
hismajesty
pandachatcopycat!
August 4, 2005, 7:09 PM
Quarantine
Yea both bad ideas!
August 4, 2005, 10:17 PM
Topaz
[quote author=hismajesty[yL] link=topic=12433.msg123076#msg123076 date=1123182581]
pandachatcopycat!
[/quote]

Flamebotcopycat!*
August 4, 2005, 10:27 PM
hismajesty
So, I don't know what that is. I do know, though, that /google was a command I put in PC. :)
August 6, 2005, 4:29 AM

Search