Sign in to follow this  
Structural

crashcourse VB

Recommended Posts

I'm trying to learn the basics of Visual basic 6 in a day. It going well so far (except that everything looks like spaghetti-code). However, what's up with modules and classes? I'm reading tutorials here, but all it says about these is that you add one to your project with a right-click->add, and you write the code... What if I don't want to right click? Are there any "tags" or identifiers that identify the code that belongs to a class? Such as in C++ you specify a "class { ... };. And how about modules?

Share this post


Link to post
Share on other sites
Umm, have you considered letting the IDE do its funky stuff, saving some sample classes/modules, and then quitting the IDE and looking at the generated files with some simpler text editor? :s

Share this post


Link to post
Share on other sites

Public Class MyVBClass

Public Sub SayHi()
MsgBox "Hi"

End Sub


End Class


Dim obj as New MyVBClass

obj.SayHi



Remember though, class support in VB6 is pretty ropey. You're best leaving it for dead and buying VB.NET, it's by far a better langugage. Faster, more powerful and has better feature support (.NET).

Share this post


Link to post
Share on other sites
Quote:
Original post by Zahlman
Umm, have you considered letting the IDE do its funky stuff, saving some sample classes/modules, and then quitting the IDE and looking at the generated files with some simpler text editor? :s


Well... I would if I had one that worked. Some crazy characterset conflict prohibits me from even opening the IDE.

Quote:
Original post by evolutional
*** Source Snippet Removed ***

Remember though, class support in VB6 is pretty ropey. You're best leaving it for dead and buying VB.NET, it's by far a better langugage. Faster, more powerful and has better feature support (.NET).


Thanks, so it works about the same. I hope I can get my greasy hands on VB.net, but since I'm supposed to use this at work I don't know if my boss is prepared to buy it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Structural

Well... I would if I had one that worked. Some crazy characterset conflict prohibits me from even opening the IDE.

....

I hope I can get my greasy hands on VB.net, but since I'm supposed to use this at work I don't know if my boss is prepared to buy it.


You're supposed to use it at work and the IDE won't even work correctly? Put that case to your boss and say that it's being counter-productive. The VB.NET IDE is 100x better and works like a dream, seriously - if you could give it a try I guarantee you won't want to go back [grin]


Cheques will not be honoured

Share this post


Link to post
Share on other sites
Quote:
Original post by evolutional
Quote:
Original post by Structural

Well... I would if I had one that worked. Some crazy characterset conflict prohibits me from even opening the IDE.

....

I hope I can get my greasy hands on VB.net, but since I'm supposed to use this at work I don't know if my boss is prepared to buy it.


You're supposed to use it at work and the IDE won't even work correctly? Put that case to your boss and say that it's being counter-productive. The VB.NET IDE is 100x better and works like a dream, seriously - if you could give it a try I guarantee you won't want to go back [grin]


Cheques will not be honoured


Well, it doesn't work on my home computer. Which is, to say the least, "quite an exotic collection of random programs and setups". I know I had to do quite some funky things before I could fully use Visual C++;. I should re-install really...
Well, tomorrow I have a working environment, so I can do some actual programming with VB.

Share this post


Link to post
Share on other sites
One thing about VB is DO EVERYTHING THE VB WAY.

Seriously. VB is one language you don't want to push too much because it will puch back by not working. I had a class module that it just stopped seeing as code once. It acted like it was just a bunch of text and didn't even try to look for code in it.

Aside from that VB is a nice little language that is very easy to use. If you don't know a function just type what you think it should be and put a "(" it will tell you what arguments it needs and everything (if you guessed right).

Share this post


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

Sign in to follow this