Need some general help with VB -_-

Status
Not open for further replies.

iamchel

In Runtime
Messages
202
Hey everyone, I think this might be my first thread Ive started:rolleyes:
but anyways I need some basic help with understanding VB

At school we're learning how to use it (dont laugh its confusing to me :p) and Im just having some difficulties. I need to make a simple program that takes an unlimited number of numbers and then calculate the average and display it in a label. Heres the basic way its supposed to work: user inputs number in text box (txtinput) then presses the 'enter number' command box (is it a box? button?). Then after they have done that same procedure as many times as they like they press the 'average' button which should then display the average of all the number combined. Now Im just confused where I need to put what code and how to set up my counter. Also how are you supposed to show text - like instructions in a vb program? Ive seen other classmates typing all of the instructions (like a paragraph) in the little caption box. I think its a little silly so I just make the label show on Form load. Is this better?

Thanks a bunch for the help.

EDIT* Im using VB 6.0
 
The best way to do this is probably just have two variables: a counter and a total. Make their scope module level (declared at the top). When the user inputs a number, add it to the total and increment the counter. When a user wants to see the average, just divide total by counter.
 
Status
Not open for further replies.
Back
Top Bottom