PDA

View Full Version : VB Challenge


Mark__C
09-25-2002, 01:30 AM
Here's a challenge for you all. Well, really just something for me, but I'm too lazy to do it on my own and I figured I'd give you all a chance to do it for me :). Anyway, I need something to search a string for all the occurences of the face emote, i.e. "':' and ')'". Then to replace it with the picture of the smiley that is included with Y!Messenger. I already have the function to replace it with the smiley picture, so I just want the function to replace all the occurrences with the picture.

Here's what I got so far (It only searches for one occurence of the smile emote though).


Dim aStr as String, aStr2 as String, aStr3 as String
Dim IntRead as Integer

StrText = "Happy :) Guy" + vbCrlf
Select Case True
Case InStr(1, StrText, ":" + Chr(41))
aStr = StdPicAsRTF(frmLobby.Smile)
IntRead = InStr(1, StrText, ":" + Chr(41))
aStr2 = Left(StrText, IntRead - 1)
aStr3 = Mid(StrText, IntRead + 2, Len(StrText))
StrText = aStr3

Case InStr(1, StrText, ":" + Chr(40))
aStr = StdPicAsRTF(frmLobby.Frown)
IntRead = InStr(1, StrText, ":" + Chr(40))
aStr2 = Left(StrText, IntRead - 1)
aStr3 = Mid(StrText, IntRead + 2, Len(StrText))
StrText = aStr3

Case Else
Output.SelStart = Len(Output.Text)
Output.SelRTF = StrText
Exit Sub

End Select

Output.SelStart = Len(Output.Text)
Output.SelRTF = aStr2 'adds substring before the ':)'
Output.SelRTF = aStr 'adds the Picture
Output.SelRTF = aStr3 'adds substring after ':)'



That's it. Good luck all and thanks!

trips
10-02-2002, 10:21 PM
I got 22 days before I leave for boot camp soon as im infront of my puter ill take a wack at it

SurGe-
10-03-2002, 05:30 PM
well im lost from the start lol ill learn more bout coding once i d/l vb6 lol

Andy
10-13-2002, 12:52 AM
hows the prog coming along mark?

Mark__C
10-13-2002, 05:25 PM
Well, I haven't been able to do alot of updating to any of my programs nor my website due to some personal stuff. However, I am reading about API so I can customize the GUI to my liking.

Andy
10-13-2002, 05:44 PM
cool, is it possible any of your progs are available for free?

-vegeta-
10-13-2002, 06:25 PM
i like ur pool program
looks great
but when is the real version of HUSTLER coming out?

Mark__C
10-13-2002, 07:34 PM
Most likely, I will just give it (when it is completed, that is) to a few close friends. This is because the more people that have such a program, the more likely it will be disabled.

-vegeta-
10-13-2002, 07:58 PM
oh aiight
im jus saying it RULES! :)

Andy
10-13-2002, 09:07 PM
yea its a nice gui, i like how you have the pool table in the background

doggy50000
10-17-2002, 09:59 PM
what is vb coding? seriously..

Can someone help me make an all star id with all-star source code? I think it is related to vb coding :)

-$mev-
10-18-2002, 02:35 PM
No its not, download visual basic 6 and get some tutorials..visual basic is a basic form of making programs.. best place to start, mark or andy... u reccomend any deceent sites for him? I duno, i do mine outta books n $hit

-vegeta-
10-19-2002, 10:32 AM
mark.limpkinw.com is where the HUSTLER Demo is, right?

Andy
10-22-2002, 07:25 PM
its not functional.. or maybe it is now, i havent checked lately