|
-
May 1st, 2008, 02:16 PM
#1
Thread Starter
Junior Member
array and reading from file
District 1 District 2 District 3 District 4
285 251 851 562 name1
521 423 874 547 name2
451 362 862 845 name3
411 562 846 245 name4
420 285 765 365 name5
this stuff reads from the file ,except districts names. I want to know how do I put these numbers(district1,2,3,4) columns into one numeric array number? for example I want to add all the numbers in district 1 and display total from that district. I also want to display total number out of all the districts. I want this to be an array.
Last edited by matase; May 1st, 2008 at 05:07 PM.
-
May 1st, 2008, 03:32 PM
#2
Re: array and reading from file
Other than reading file line-by-line, splitting numbers into say some temp array and increment some variables you wouldn't have many other options...
However, if you can substitute text file with database (perhaps MS Access) it could be as simple as executing very basic sql:
select sum(filed1) where field2 = 'District1'
-
May 1st, 2008, 05:07 PM
#3
Thread Starter
Junior Member
Re: array and reading from file
there is no way to do that without rearranging the txt file to do that in VB 6.0? I guess I will have to make 4 different variables to get the total of each one.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|