PDA

View Full Version : VB 6 questions



Artha
03-24-2004, 11:31 PM
A couple quick questions before I go to bed about arrays in VB.

Would the following code work?:



Const x = 0

Private Sub cmdstuff_click()

udtExample.ExampleValue(x) = Val(txtExample.text)
x = x+1



Also, how would I code a loop to look through the data that has been entered and find a percentage of the data above a certain level, using data from array.

Example:
Finding percentage of homes below the poverty level. Assuming the poverty level is 8000 annual income for 1-2 members, +2000 for each member beyond 2.

How the hell do I make it display in a 3 column format?

Example:



ID Annual Income Number of Persons
1 20000 4
2 8000 2
3 6000 1
4 15000 5
5 18000 8
etc


I'd prefer to be able to stick it all in one label.