Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: ColT on July 20, 2004, 02:00 PM

Title: What does this mean?
Post by: ColT on July 20, 2004, 02:00 PM
What does Chr(3), Chr(4), and vbCrLf mean

It was posted somewhere by Grok[vL], and I don't know what it means, the full code is:

Private Sub ws_Connect ()
 AddChat vbYellow, "Connected."
 SendData Chr(3) & Chr(4) & vbCrLf
End Sub
Title: Re:What does this mean?
Post by: MyndFyre on July 20, 2004, 02:40 PM
Quote from: ColT on July 20, 2004, 02:00 PM
What does Chr(3), Chr(4), and vbCrLf mean

It was posted somewhere by Grok[vL], and I don't know what it means, the full code is:


Private Sub ws_Connect ()
 AddChat vbYellow, "Connected."
 SendData Chr(3) & Chr(4) & vbCrLf
End Sub


It means that upon the Connect event of a WinSock control named ws, you want to add the text "Connected" in yellow to the rich text box, then send a byte value of 3, a byte value of 4, and the constant carraige-return-line-feed value over the WinSock control.

Well, that's what the code means.  Chr(3), Chr(4), and vbCrLf mean a byte value of 3, a byte value of 4, and the constant carraige-return-line-feed.

If you don't know what Chr() and vbCrLf are, I suggest you learn Visual Basic.  This isn't the place.
Title: Re:What does this mean?
Post by: ColT on July 20, 2004, 02:53 PM
Well thanks I understand it a bit more, and yes I am reading a 1031 page VB book I am on page 700 somthing...
Title: Re:What does this mean?
Post by: MyndFyre on July 20, 2004, 03:00 PM
Quote from: ColT on July 20, 2004, 02:53 PM
Well thanks I understand it a bit more, and yes I am reading a 1031 page VB book I am on page 700 somthing...

By page 700, if you don't know what Chr() or vbCrLf do, I'd go back to the beginning.
Title: Re:What does this mean?
Post by: Zakath on July 20, 2004, 10:56 PM
Even I know what they mean, and I've never read such a book nor coded even "Hello World" in VB.
Title: Re:What does this mean?
Post by: OnlyMeat on July 21, 2004, 08:38 PM
Quote from: Zakath on July 20, 2004, 10:56 PM
Even I know what they mean, and I've never read such a book nor coded even "Hello World" in VB.

Ye but i bet you do c++ or alike which uses similar terms when formating strings i.e
printf(szBuf,"Hello world from %s\r\n",szSomeone);

where the \r\n are equivilent to control line feed.

There are alot of consts etc in vb and c++ for that matter that people who are new to programming would not automatically know so give the guy a break.
Title: Re:What does this mean?
Post by: shadypalm88 on July 21, 2004, 10:41 PM
Quote from: OnlyMeat on July 21, 2004, 08:38 PMThere are alot of consts etc in vb and c++ for that matter that people who are new to programming would not automatically know so give the guy a break.
I think the point is he should have a handle on the basics of VB before attempting to write a bot using it, or he should've at least known where to find the answer on his own, like in his 1031-page VB book, or even VB's object browser or VB/MSDN docs.
Title: Re:What does this mean?
Post by: OnlyMeat on July 22, 2004, 02:48 AM
Damn thats a big ass book lol, msdn so much easier .
i cant believe anyone uses real books anymore i only use ebooks//msdn :)
Title: Re:What does this mean?
Post by: Tuberload on July 22, 2004, 02:51 AM
Quote from: OnlyMeat on July 22, 2004, 02:48 AM
Damn thats a big ass book lol, msdn so much easier .
i cant believe anyone uses real books anymore i only use ebooks//msdn :)

I personally prefer textbooks to ebooks. Easier on my eyes, I get fewer headaches, plus I can wonder around, and sit in any position I want while reading it.  It is also easier to flip through pages. :)
Title: Re:What does this mean?
Post by: hismajesty on July 22, 2004, 10:17 AM
Quote from: Tuberload on July 22, 2004, 02:51 AM
Quote from: OnlyMeat on July 22, 2004, 02:48 AM
Damn thats a big ass book lol, msdn so much easier .
i cant believe anyone uses real books anymore i only use ebooks//msdn :)

I personally prefer textbooks to ebooks. Easier on my eyes, I get fewer headaches, plus I can wonder around, and sit in any position I want while reading it.  It is also easier to flip through pages. :)

I agree, I have a lot of ebooks on programming but I've only used them for quick reference. They hurt my eyes to read and are harder to follow imo. I'd rather spend the money to get a real book.
Title: Re:What does this mean?
Post by: tA-Kane on July 22, 2004, 12:46 PM
The best thing with ebooks is the find feature. If you try it on the right book, it's just like google.