Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Random Access Files

Status
Not open for further replies.

xathras

Technical User
May 8, 2003
32
GR
Hi,

I need to be able to calculate 7 measurements of temperature and have a date. So far, I have a csv looking like this:

07/05/2003,12,34,4,45,23,27,49
08/05/2003,5,22,1,40,20,15,33

As you can see each line has commonalities:

date,measurement1,measurement2,measurement3,measurement4,measurement5,measurement6,measurement7

I have had a look in one of the VB books I have which only touches on the subject of Random Access Files so I only have a brief understand

So far i have worked out that I need to create a type

type measurements
date as string * 9


do i go from msr1 all the way to msr7 as measurements, or can this be msr[6] as an array?

I think the array would be better but I could be wrong


As from there I dont know any more about opening the csv for read, write etc.

Any help would be appreciated
 
private type yourData
yourDate as Date
yourMeasures(6) as integer
end type

then use the open statement to load and save (see MSDN for more info on the open statement!)

good luck!

If somethings hard to do, its not worth doing - Homer Simpson
------------------------------------------------------------------------
A General Guide To Excel in VB FAQ222-3383
File Formats Galore @
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top