Karl Blessing
Programmer
Below is the entire source, basically what I have is a *.dat file that has the structure of 'Sic2File' , I need to create a new dat file that has it's lat/lng bit as longs, and not doubles, I have a problem on the highlighted line below colored in red, the error says
Run-Time Error '5':
Invalid procedure call or argument
The Source
[tt]
Private Type Sic2File
Sic4 As Byte
latbit As Double
lngbit As Double
id As Long
End Type
Private Type Sic2Convt
Sic4 As Byte
latbit As Long
lngbit As Long
id As Long
End Type
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_DblClick()
Dim Sic2er As Sic2File
Dim SicCvt As Sic2Convt
Dim SicFile
Dim Looper As Long
Looper = 1
If Right(File1.Path, 1) = "\" Then
Open File1.Path & File1.FileName For Random As #1 Len = Len(Sic2er)
Open File1.Path & "c_" & File1.FileName For Random As #2 Len = Len(Sic2Convt)
Else
Open File1.Path & "\" & File1.FileName For Random As #1 Len = Len(Sic2er)
Open File1.Path & "\c_" & File1.FileName For Random As #2 Len = Len(Sic2Convt)
End If
Do Until EOF(1)
Get #1, , Sic2er
'Read Data
SicCvt.id = Sic2er.id
SicCvt.latbit = Sic2er.latbit
SicCvt.lngbit = Sic2er.lngbit
SicCvt.Sic4 = Sic2er.Sic4
'Write Data
Put #2, , SicCvt
Loop
Close #1
Close #2
End Sub
[/tt]
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)
Run-Time Error '5':
Invalid procedure call or argument
The Source
[tt]
Private Type Sic2File
Sic4 As Byte
latbit As Double
lngbit As Double
id As Long
End Type
Private Type Sic2Convt
Sic4 As Byte
latbit As Long
lngbit As Long
id As Long
End Type
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_DblClick()
Dim Sic2er As Sic2File
Dim SicCvt As Sic2Convt
Dim SicFile
Dim Looper As Long
Looper = 1
If Right(File1.Path, 1) = "\" Then
Open File1.Path & File1.FileName For Random As #1 Len = Len(Sic2er)
Open File1.Path & "c_" & File1.FileName For Random As #2 Len = Len(Sic2Convt)
Else
Open File1.Path & "\" & File1.FileName For Random As #1 Len = Len(Sic2er)
Open File1.Path & "\c_" & File1.FileName For Random As #2 Len = Len(Sic2Convt)
End If
Do Until EOF(1)
Get #1, , Sic2er
'Read Data
SicCvt.id = Sic2er.id
SicCvt.latbit = Sic2er.latbit
SicCvt.lngbit = Sic2er.lngbit
SicCvt.Sic4 = Sic2er.Sic4
'Write Data
Put #2, , SicCvt
Loop
Close #1
Close #2
End Sub
[/tt]
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)