Need Help learning VB6

seithon

Gawd
Joined
Oct 11, 2000
Messages
736
Hey folks.. I've got a serious problem.
One of the modules on my PC course is a "Vb" section, the problem being that the teacher is a chancer and basically is doing fuck all.
At best we get VERY brief desriptions of things, and the information is given parrot fashion all of us in the class have problems with this module.
For example we didnt know what a string was properly till a month back in our systems software class when talking about registery keys, even though we "covered" it in the VB thing a few months back.

At anyrate, for me personally i have to write a small program, its simple enough and i have it planned out neatly, the problem is that i dont know how to translate the "written" program into functional code, and searching on google sends me to lots of books and sites that pay for answers.

I dont have the exact notes with me so for now if someone could point to me to some sites with good basic info for beginers i'd be gratefull, and later i'll post up the "written" program i came up with.
 
I know they are :)
I've been about Hardocp for some timenow! :) (its kinda surprising to me too)
but the problem for me is, that i dont "get" it right now,
I could ask, and ask and drive people nuts :p I've gone and ordered VB6 for dummies and a "teach yourself VB" book also.
thanks for your link :)
 
i'm not sure weather you mean that in a "is this your first language "english" " or "first programming language"

as to the latter i would hope that my language would be good enough to show that english is my primary, if not allways clear and precise language,

and yes VB is my first programming language.
I am somewhat proficent with HTML/CSS etc, but this is a big step up from that.
also our teacher has made things worse for me, as what little we do know is generally either inaccurate (see "lies my teacher taught me") or in a parrot fashion.
 
Wow! This sounds like a teacher I had at ITT Tech. Guy was a real nut job...

I'll tell you what I taught the rest of my class to help them learn to program.

Write down what you want to do in plain simple english. Then, take each word, one at a time, and make it a command in VB.

HTML:
Take 2 dollars, put them in the bank. Then put 2 more dollars in the bank<br>
2 dollars put in bank. 2 more dollars put in bank<br>
bank = 2 dolars. 2 more dollars = bank<br>

VB Code:<br>
Dim bank as integer
bank = 2<br>
bank += 2

These are your variable types:

integer = whole numbers
float = numbers with decimals
string = text
double = bigger version of float
boolean = true or false, yes or no
date = duh! I really don't need to explain this

Dim is used to declare a variable and is used like "Dim something as type" where type is one of the above and the something is whatever you want to name the variable. Variables simply hold information.
 
thanks mage :)
thats kinda to the point i've gotten, writing it out, its just translating it from there i have difficulty with.
problem is i dont have my notes with me, but the thing were doing is like this..

A simple program that reads in date from a txt file, loads it into memory and displays it in a picture box, a button to calculate the amount of money you have to pay back per month at an interest rate of 3.5 percent over a number of years. and finally a button to save the results ot a new file...

i worked it into something like this...

a "load button" which opens the "file" loads the information into memory and displays the values "name" "morgage amount" and "rate" and "years" with a blank space for "payments"
then another button called
"calculate"
Which takes the information from memory, in this case Amount, years and then multiplies the amount by 3.5 and adds the result to the amount, then divides by the number of years, and then by 12 to get the amount payed per month.

After that the payments per month is added to memory and the picture box is refreshed to display the "name" "amount" "rate" "years" "payments per month".
then the person can "save" it, creating a new file with those values written into it.

all in all.. its a kinda pointless crappy program -_-
But thats what it is...

edit for funny story.
On a side note, the guy wanted me to duplicate a dvd for him, 50 times, and was going to pay me 500€ for it... this was btw totally illegal, ontop of that, he wanted me to INVOICE him for it so he could write it off the school as an expense... i of course turned him down.. but god what a moron -_-
 
It looks like you're well on your way to getting it solved. Unfortunatly I don't remember much VB6 code at all, I've been programming in VB .NET which changed almost everything but the basics.

I do remember a few quick tricks though that I'll pass on to you.

These will let you create a file handler to use for the Open file command. I think it's fileopen but like I said, it's differnet in VB 6 than in VB.NET.
Dim File as Integer
File = FreeFile()

Your statement to open the file directly can be reversed by changing OpenMode.Input to OpenMode.Output, just make sure you change file name if you don't want to delete the origional file ;)
 
thanks mage :)
That part isnt hard to me, i've allways been able to break down tasks like that easily enough in day to day life, its the converting it to language that bothers me, of course what REALLY gets me is that all this stuff is allready out dated by .net etc -_-
 
hey its okay mage :) atleast your offering advice.. more then some are :p
thanks for your encouraging words too :)
 
Just finished my vb6 class tonight ;) Just a few hints

Open file (in the format of "c:\test\hello.txt" for input as #1

Input #1, variable1, variable2, variable3

Close #1

Can't remember for the life of me how to display text in a picture box, sorry.

Hmmm, before I type out half the program... how much of it do you have done? :p
 
Geez, now I'm getting qbasic flashbacks. :)
(What you posted is IIRC valid qbasic as well. Scary stuff.)
 
thanks, and thanks zel :)
in all honestly just what i wrote above :p
thing is i cant for the life of me remember ANY of the functions and being at home for christmass i dont have my notes with me..
but i dont expect anyone here to type it all out for me, it would defeat the purpose.. which is in this case me figuring out what to do with what :p
 
Back
Top