Function Help: QBColor()

Snippets, Projects and Assistance

Moderators: Moderator, Global Moderator

Post Reply
Josh
Newbie
Newbie
Posts: 0
Joined: Fri Jun 04, 2004 2:54 pm

Function Help: QBColor()

Post by Josh »

Okay, Jake might know what I\'m doing but a lot of others don\'t so here goes..

I have this RichTextBox control and well I\'m using "QBColor(<insert number>)" for changing of colors and I have parsed the \'short motd\' from the PSO server into this:
- 2/10/2004 13
- This is the short MOTD. To view the complete MOTD type /motd
-
- Welcome to irc.isyourgod.com!
-
- ****************************************************
- Services Available
- * MemoServ - Memo Server ( 32896/msg memoserv help0 for info )
- * ChanServ - Channel Server ( 32896/msg chanserv help0 for info )
- * NickServ - Nickname Server ( 32896/msg nickserv help0 for info )
- * To View Server Rules ( 32896/rules )
-
- ****************************************************
Now if you look at where the "/msg memoserv,chanserv,nickserv help" is there is a number.. This number is QBColor(6) (which is purple by the way) yet it should work for changing colors because this is my coding for the replacement of the raw code for color codes on the IRC Protocol:

Code: Select all

Function DefineColors&#40;&#41;
Status.SelColor = QBColor&#40;0&#41;
Data = Replace&#40;Data, "10", "<CODE>"&#41;
Data = Replace&#40;Data, "11", QBColor&#40;11&#41;&#41;
Data = Replace&#40;Data, "12", QBColor&#40;9&#41;&#41;
Data = Replace&#40;Data, "13", QBColor&#40;13&#41;&#41;
Data = Replace&#40;Data, "14", QBColor&#40;8&#41;&#41;
Data = Replace&#40;Data, "15", QBColor&#40;7&#41;&#41;
Data = Replace&#40;Data, "0", QBColor&#40;15&#41;&#41;
Data = Replace&#40;Data, "1", QBColor&#40;0&#41;&#41;
Data = Replace&#40;Data, "2", QBColor&#40;2&#41;&#41;
Data = Replace&#40;Data, "3", QBColor&#40;3&#41;&#41;
Data = Replace&#40;Data, "4", QBColor&#40;12&#41;&#41;
Data = Replace&#40;Data, "5", QBColor&#40;5&#41;&#41;
Data = Replace&#40;Data, "6", QBColor&#40;6&#41;&#41;
Data = Replace&#40;Data, "7", "<CODE>"&#41;
Data = Replace&#40;Data, "8", "<CODE>"&#41;
Data = Replace&#40;Data, "9", QBColor&#40;10&#41;&#41;
Data = Replace&#40;Data, "", QBColor&#40;0&#41;&#41;
Data = Replace&#40;Data, "", ""&#41;
Data = Replace&#40;Data, "", ""&#41;
End Function
Now the ones with "<CODE>" are the ones I don\'t have the colors for yet, but that\'s not important..

The "Data" is the IRC data that is recieved.. So in the Winsock data arrival event I just put the following to replace the data and all that good stuff

Code: Select all

DefineColors
and do note this is right after Winsock1.GetData Data, vbString...

I think that\'s all the code I need to give you and now the question:

Why is it putting numbers there instead of putting colors?

Thanks in advance (Sorry for really humungo post <img src=\'http://www.killanet.net/forum3/public/s ... >/blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />)

~Josh <img src=\'http://www.killanet.net/forum3/public/s ... sp_ike.gif\' class=\'bbc_emoticon\' alt=\'(spike)\' />
Last edited by Josh on Fri Nov 05, 2004 3:51 am, edited 1 time in total.
[align=center]

Image

“If you stop learning, you stop living.” ~Tami Quiring

“It's the rare man who understands the value of a single perfect rose.”

[/align]
FlyingDoggyJake
Newbie
Newbie
Posts: 0
Joined: Thu Jun 17, 2004 12:37 am

Function Help: QBColor()

Post by FlyingDoggyJake »

The reason you\'re getting a number rather than a color is because the QBColor protocol will NOT work within the Replace function protocol. The replace function is looking for a string as it\'s third parameter. Instead of giving it a string you offered it another function (ie. the QBColor function), which has a [color=\"BLUE\"]Long[/color] return value. Instead of erroring, the replace function took the numerical value of the QBColor function and converted it to a string. Thus, you got wonky results!

I realize this post is a little old, and I know that we\'ve talked about mIRC colors lots since then, but I thought I best answer it in case any one else reads it <img src=\'http://www.killanet.net/forum3/public/s ... /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' />
ImageImage
Post Reply

Return to “Visual Basic”