thepunisher
Programmer
Hi,
I want to read in two binary files, then save the contents to two arrays, how do i do this?
I am converting fortran code to vb6, so i am not really sure what im doing, so any VB code that saves binary file data to arrays is welcome.
Thanks,
thePunisher
PS- Below is my code so far....
'input files :
'open (unit=5, access="sequential", carriagecontrol="list", '+form='formatted', organization='sequential', readonly,
'+status="old")
'
Open "C:\David McGarry\Week14\20 September 2004\Modloads\DAVE.BIN" For Append As #1
'open (unit=21, access='direct', form='unformatted',
'+maxrec=375, organization="sequential", readonly, recl=64, 'DO AN OPEN
'+recordtype="fixed", status="old")
'output Files:
'I want to open two output files....
'open (unit=6, access="sequential", carriagecontrol="list", '+form='formatted', organization='sequential',
'+status="replace")
'
'open (unit=22, access='direct', form='unformatted',
'+maxrec=375, organization="sequential", recl=64, recordtype="fixed",
'+status="replace")
'write blank line at the start:
Open "C:\David McGarry\Week14\20 September 2004\Modloads\report.txt" For Append As #2
L49:
'format ()
For INDEX1 = 1 To DAYS_PER_YEAR '1 to 365.
' read (unit=21, rec=index1) nrec, date, month, year,
' + (load(hhour),hhour=1,loads_per_day), dayno, weekno, period,
' + kode, isys, (fill_out(index2),index2=1,7)
For INDEX2 = 1 To LOADS_PER_DAY 'There are 48 loads per day.
LOADARRAY1(INDEX1, INDEX2) = LOAD(INDEX2)
LOADARRAY2(INDEX1, INDEX2) = LOAD(INDEX2)
Next
Next
'Close #1: Exit Sub
Close #1: Exit Sub
Close #2 'Close the file.
MsgBox ("Initialised")
The Wolf: Thats 30 minutes away. I'll be there in 10.
I want to read in two binary files, then save the contents to two arrays, how do i do this?
I am converting fortran code to vb6, so i am not really sure what im doing, so any VB code that saves binary file data to arrays is welcome.
Thanks,
thePunisher
PS- Below is my code so far....
'input files :
'open (unit=5, access="sequential", carriagecontrol="list", '+form='formatted', organization='sequential', readonly,
'+status="old")
'
Open "C:\David McGarry\Week14\20 September 2004\Modloads\DAVE.BIN" For Append As #1
'open (unit=21, access='direct', form='unformatted',
'+maxrec=375, organization="sequential", readonly, recl=64, 'DO AN OPEN
'+recordtype="fixed", status="old")
'output Files:
'I want to open two output files....
'open (unit=6, access="sequential", carriagecontrol="list", '+form='formatted', organization='sequential',
'+status="replace")
'
'open (unit=22, access='direct', form='unformatted',
'+maxrec=375, organization="sequential", recl=64, recordtype="fixed",
'+status="replace")
'write blank line at the start:
Open "C:\David McGarry\Week14\20 September 2004\Modloads\report.txt" For Append As #2
L49:
'format ()
For INDEX1 = 1 To DAYS_PER_YEAR '1 to 365.
' read (unit=21, rec=index1) nrec, date, month, year,
' + (load(hhour),hhour=1,loads_per_day), dayno, weekno, period,
' + kode, isys, (fill_out(index2),index2=1,7)
For INDEX2 = 1 To LOADS_PER_DAY 'There are 48 loads per day.
LOADARRAY1(INDEX1, INDEX2) = LOAD(INDEX2)
LOADARRAY2(INDEX1, INDEX2) = LOAD(INDEX2)
Next
Next
'Close #1: Exit Sub
Close #1: Exit Sub
Close #2 'Close the file.
MsgBox ("Initialised")
The Wolf: Thats 30 minutes away. I'll be there in 10.