Page 1 of 2 12 LastLast
Results 1 to 40 of 75

Thread: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Okay. Lets get this straight. You want to be a programmer when you grow up right? "Right". Well, you have to learn to make decent programs. It takes time to learn a programming language, and more time to master it. You can't learn a programming language in one day and know how to make a advance game or application.

    Programming.

    A. Where to Start



    Rome wasn't built in a day...

    Programming is something that takes time to learn and even more time to master. You can't expect to read one book or take one class and start writing serious applications or games.






    You have two options for learning programming:

    A) Start in the shallow pool and move to the deep pool later on.



    B) Go straight to the deep pool and try to hold yourself up using flotation devices.



    I have friends that have tried starting out with programming languages such as Pascal/Turbo Pascal, Delphi, and Java and transitioned to C++ and Visual Basic. I found this way of learning to be a waste of time, considering I knew where I wanted to be before I started learning programming. So, I started out with visual basic.



    If you are bad at organization and logic, you might want to try a higher level language such as Delphi before attempting to tackle C++. Delphi and C++ are structurally similar, so you will get the hang of C++ if you spent time learning Delphi.

    In the event that you choose to take this route, I recommend downloading Game Maker. Game Maker is basically a development kit for people who are at entry level and want to learn the fundamentals of game creation. It was written in Delphi and includes its own scripting language in addition to using Delphi.

    www.gamemaker.nl



    B. Resources and Source Code

    * http://www.devshed.com
    * http://www.vbcode.com (source code)
    * http://www.programmingtutorials.com
    * http://www.programmersheaven.com
    * http://www.pscode.com
    * http://rookscape.com/vbgaming/ (physics related programming stuff, good for making games with vb 6.0)

    Okay, now the coding part.

    So what would a beginner like to make? Lets start with a classic Hello World application.

    Code:
    Command1_Button
    MsgBox ("Hello World")
    End Sub
    This code means if you press the button you created, it will pop up the message "Hello World!". Remember, if you want to make a message always USE THE PARENTHESIS! If you get into a habit of not using the parenthesis, it will hurt you in the future! And remember, anything that is in parenthesis will be the text the your program will make. So if you put

    Code:
    Print "How are you?"
    In a button, when you press the button it will make the text "How are you" at 00 xy axis. But heres another thing.

    There are many methods to do this, heres another one.

    Code:
    A = "How are you?" 
    Print A
    This can be another method, its both the same thing. Now, moving onto numbers. Heres the tricky part (for beginners).

    NEVER DO THIS. ALOT OF PEOPLE MAKE BIG MISTAKES JUST BY MISTAKING THESE.

    Code:
    A = "5"
    Print "A"
    Guess what this code does? Okay so you want it to print the number 5 right? But instead it prints A because like i said, anything in quotes "" will be printed. It doesn't matter if you put "5" because you put "A" also, and you told it to print "A" instead of 5. To fix this error, what do you think we should do?

    Code:
    A = "5"
    Print A
    If you were thinking about getting rid of the quotes "" around A, you're right. Now the program will print 5 instead of A.

    Alright now that you got a little better, lets move on.

    More Advance Stuff

    Now we're going to make a calculator. What kind? Add, Subtract, Multiply, and Divide.

    Coding this calculator will make a big difference for you, in the future.



    Code:
    Private Sub Command1_Click()
    //to add
    Dim a As Integer
    Dim b As Integer
    a = Text1.Text
    b = Text2.Text
    Label4.Caption = Text1.Text + Text2.Text 
    //to subtract
    Private Sub Command1_Click()
    Dim a As Integer
    Dim b As Integer
    a = Text1.Text
    b = Text2.Text
    Label4.Caption = Text1.Text - Text2.Text
    //to multiply
    Private Sub Command1_Click()
    Dim a As Integer
    Dim b As Integer
    a = Text1.Text
    b = Text2.Text
    Label4.Caption = Text1.Text * Text2.Text
    //to divide
    Private Sub Command1_Click()
    Dim a As Integer
    Dim b As Integer
    a = Text1.Text
    b = Text2.Text
    Label4.Caption = Text1.Text / Text2.Text
    
    End Sub
    ALright, remember, + = add, - = subtract, *=multiply, and /=divide

    So take a look at the code above. I made 1 button, 8 textboxes, and 4 labels. The button is the most important, it is used to calculate. The button contains the most code.

    So the label4.caption is where the answer will be printed. Text1.Text and Text2.Text are important too, its where you put the 2 values to add/subtract/multiply/divide.

    So if Text1.Text + Text2.Text, those 2 values are added
    if Text1.Text - Text2.Text, those 2 values are subtracted
    if Text1.Text * Text2.Text, those 2 values are multiplied
    if Text2.Text / Text2.Text, those 2 values are divided.

    Thank you for your time reading this, please be successful for whatever you do, you're brain is the most important part, use it or lose it. You need a brain to make good programs, and i also alot of patience. May your wishes come true, and again, be successful in life. I hope this tutorial will wipe out some questions.

    -DopeyGuy123


    This tutorial was created by DopeyGuy123
    Last edited by DopeyGuy123; Mar 24th, 2005 at 08:15 PM.

  2. #2
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    my suggestion for a beginning, is always a timer..It got me into learning this whole bunch of stuff

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    A timer is kind of advance...well its your opinion. In my opinion, a form and command button is the easiest...those were the first things i knew when i was a beginner at programming...

  4. #4
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    a timer is crazy easy, just add one and a textbox, then text1.text = text1.text +1

    voila!
    that seems alot easier than your calculator

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    lol okay....but i prefer command button. Anyways, thanks for the suggestion. May i ask, do you like my tutorial?

  6. #6
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    ye sure, very short though..
    i like this one http://cuinl.tripod.com/tutorials.htm

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    lol me and you are the only posters...

  8. #8
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    This thread is sooooo gonna be moved to the CodeBank - Visual Basic 6 (and before) once MartinLiss or any moderators/administrators see this

    Timers are good for beginners to learn loops and stuff for games, but the fact of the matter is that Timers are slow, inaccurate, inconsistant, and get worse when you use more of them. Learned that the hard way back in the day when I was hooked on them using them in my games. C++, C#, Java, Delphi, and all those other languages don't have Timers. They use Do loops and While loops, which should be used in VB rather than Timers. If programmed right, you can have a real time managed loop going for your game or application.

  9. #9
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    C++, C#, Java, Delphi, and all those other languages don't have Timers. They use Do loops and While loops, which should be used in VB rather than Timers. If programmed right, you can have a real time managed loop going for your game or application.
    What???? I use timers in C++ and Delphi all the time.... Do loops for timing? Yeah I used that back in the '80s . But I agree that the VB timer is not the best timer available on most system now days. Most computers of today have multimedia timers built into their hardware.

  10. #10
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Since when are people using Timers in those languages?

    Unless of course you are using API's

    [Edit] By the way, Timers on VB go like 10 times faster on XP for some reason. making it really really inconsistant and inaccurate.

  11. #11
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    Since when are people using Timers in those languages?

    Unless of course you are using API's
    Of course I'm using the API, but they are still timers.

  12. #12
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    QuickBasic had ON TIMER, and my old HP-85 (from the 60's had an incredible timer built in. accurate to the millisecond)

  13. #13
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Well, may i ask..How do you tell a loop how fast to go? Is it possible?Like you can set the interval on a timer..

  14. #14
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by |2eM!x
    Well, may i ask..How do you tell a loop how fast to go? Is it possible?Like you can set the interval on a timer..
    Yeah you can say that. Like this one for example. It locks the FPS (frames per second, and maintains that frame rate in real time.
    Attached Files Attached Files

  15. #15
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by |2eM!x
    Well, may i ask..How do you tell a loop how fast to go? Is it possible?Like you can set the interval on a timer..
    Well you can check the time in a loop and do stuff after a specific time has expired. A common function is the GetTickCount (which is a timer function btw, but it doesn't raise any events or have any callbacks). The fact that GetTickCount works means that Windows itself has timers running all the time , and last time I looked Windows wasn't written in VB, LOL.

  16. #16
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    In my sample project a couple posts above, I uses the QueryPerformanceCounter and QueryPerformanceFrequency API's which is 1 ms accurate. GetTickCount is 10 ms accurate. So those other 2 apis are better.

  17. #17
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    In my sample project a couple posts above, I uses the QueryPerformanceCounter and QueryPerformanceFrequency API's which is 1 ms accurate. GetTickCount is 10 ms accurate. So those other 2 apis are better.
    Yeah I know that. I've already stated that Multimedia timers are more accurate, but you can't say that the QueryPerformance functions are 1 ms accurate because it depends on the hardware of the computer.

  18. #18
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    I updated it a little since I forgot a couple of things. This should do it.
    Attached Files Attached Files

  19. #19
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    What it all comes down to though is how accurate you really need to be. If you only need to run a specific code once every second or so or maybe 2 or 3 times each second the VB timer will do the job. If you want a specific task to run every hour or maybe just once per day the SetTimer API function would probably be the best choice since you can pass a Long as the interval. But if you really are in demand of a high resolution timer you should of course use one (if one is available on your system).

  20. #20

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    This thread is sooooo gonna be moved to the CodeBank - Visual Basic 6 (and before) once MartinLiss or any moderators/administrators see this

    Timers are good for beginners to learn loops and stuff for games, but the fact of the matter is that Timers are slow, inaccurate, inconsistant, and get worse when you use more of them. Learned that the hard way back in the day when I was hooked on them using them in my games. C++, C#, Java, Delphi, and all those other languages don't have Timers. They use Do loops and While loops, which should be used in VB rather than Timers. If programmed right, you can have a real time managed loop going for your game or application.
    Why isn't this moved yet? I want beginners to read this, so they can learn and at least have some knowledge of basic programming. I am not saying im a ub3r pro programmer for vb 6.0, im just saying i want to help beginners, give them knowledge. Oh yeah, Jacob Roman, why did u say quote

    "This thread is sooooo gonna be moved to the CodeBank - Visual Basic 6 (and before) once MartinLiss or any moderators/administrators see this"

    Is that good or bad?

  21. #21
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    It's not really CodeBank material, I guess.

  22. #22

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by dglienna
    It's not really CodeBank material, I guess.
    kool...i dun want it to be in the codebank, no one goes there! It doesn't have that much topics...

  23. #23
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    I doesn't have topics at all. It has descriptions of projects, some explanations, and a zip file of the project. It includes SOURCE CODE. Hence, it's called the CodeBank.
    This is a thread that describes a few things that you know, that can be searched in the future if anyone wants to know the answers to some of the same questions.

  24. #24

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by dglienna
    I doesn't have topics at all. It has descriptions of projects, some explanations, and a zip file of the project. It includes SOURCE CODE. Hence, it's called the CodeBank.
    This is a thread that describes a few things that you know, that can be searched in the future if anyone wants to know the answers to some of the same questions.
    alright....if you have some friends that just started vb, tell them to take a look at my tutorial. Or you could just receive help from a book, or the internet of coruse.

  25. #25
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Anybody that searches for tutorial will get a link to this.

    I would take your name out of the title, though.

  26. #26

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by dglienna
    Anybody that searches for tutorial will get a link to this.

    I would take your name out of the title, though.

    why would you take my name out of the title?

  27. #27
    Junior Member
    Join Date
    Mar 2005
    Location
    Calgary Alberta
    Posts
    17

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    If I ever write a book, I'll make it teach everyone all of the controls and how to use them and their properties and stuff, the command button comes first then a timer then a textbox then a label. and i'll teach them about msgboxes and inputboxes and how to detect what the input is. You should add that

  28. #28

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Turiya
    If I ever write a book, I'll make it teach everyone all of the controls and how to use them and their properties and stuff, the command button comes first then a timer then a textbox then a label. and i'll teach them about msgboxes and inputboxes and how to detect what the input is. You should add that
    this is beginners level 1, im not making it that hard.

  29. #29
    Junior Member
    Join Date
    Mar 2005
    Location
    Calgary Alberta
    Posts
    17

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    You gonna make sequels?

  30. #30
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    The reason why I said that this would get moved in the CodeBank is because I had like maybe a couple tutorials of my own moved there. Like the thread "DoEvents is slow!!! Here are faster methods" It was like a tutorial as well as info, but it got moved anyways. Probably because I uploaded code projects in there. I assumed that all tutorials get moved there as well.

  31. #31
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    No offense, but I don't think I'd look for a DOPEY tutorial. Maybe it's just me.

  32. #32
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by dglienna
    No offense, but I don't think I'd look for a DOPEY tutorial. Maybe it's just me.
    Good insite

  33. #33
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by DopeyGuy123
    this is beginners level 1, im not making it that hard.
    Level 2: Realtime 3D Game Programming using DirectX8 and OpenGL using VB

    Now we are getting somewhere.

  34. #34

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    Level 2: Realtime 3D Game Programming using DirectX8 and OpenGL using VB

    Now we are getting somewhere.
    lmao...jacob you are just funny.

  35. #35
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by DopeyGuy123
    lmao...jacob you are just funny.
    Who said I was joking

    Just look at what VB can do for ya. Here's a snapshot my R-Type 3D game I'm working on:
    Attached Images Attached Images  

  36. #36

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    Who said I was joking
    oh....lol. That seems hard though >.<

  37. #37
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    I edited my post and added a screen shot of one of the games I'm working on. It isn't that hard. Try it sometime. Did wonders for me

  38. #38

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    I edited my post and added a screen shot of one of the games I'm working on. It isn't that hard. Try it sometime. Did wonders for me
    nice =D but the graphics is a little bit blury...

  39. #39
    Computer Science BS Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,339

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by DopeyGuy123
    nice =D but the graphics is a little bit blury...
    It's called anti-aliasing, which blends the pixels together to make it look more realistic.

    I'm gonna reupload an update to my game. Just give me 20 minutes and you'll see an update. Tell me what you think. It's located here:

    www.angelfire.com/fl5/memorydll/index.html

    Note to XP users: I think I might have fixed this problem, but if you see only half the game with it cut off diagnally, I may have to get rid of the fade-in/fade-out effect.

    Controls:
    ---------------
    Arrow Keys - Moves ship
    Space - Fire (hold down for autofire)
    Numpad - Moves Camera
    Mouse - Free looking camera
    F12 - Snapshot
    Esc - Exits the program after it fades out.

  40. #40

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    109

    Re: Dopey's Visual Basic 6.0 Tutorial Beginners Level 1

    Quote Originally Posted by Jacob Roman
    It's called anti-aliasing, which blends the pixels together to make it look more realistic.

    I'm gonna reupload an update to my game. Just give me 20 minutes and you'll see an update. Tell me what you think. It's located here:

    www.angelfire.com/fl5/memorydll/index.html

    Note to XP users: I think I might have fixed this problem, but if you see only half the game with it cut off diagnally, I may have to get rid of the fade-in/fade-out effect.
    alright i'll be waiting

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width