|
-
Aug 21st, 2001, 12:20 AM
#1
Thread Starter
New Member
problem in input string
hi,
i am reading a file & writing to other file but i found that output file have more characters then input file. my code is as follows, any one test with their file & give me some sugguestion.
Private Sub Command1_Click()
Dim tfile As String
Dim ofile As String
Dim outfile As String
Dim intf As Long
Dim intf1 As Long
intf = FreeFile
tfile = "c:\temp\iii.hex"
intf = FreeFile
Open tfile For Binary Access Read As #intf
outfile = Input(LOF(intf), #intf)
ofile = "c:\temp\177.hex"
intf1 = FreeFile
Open ofile For Output As #intf1
Write #intf1, 1, outfile;
Close #intf1
Close #intf
End
End Sub
thanx
arunpatel
-
Aug 21st, 2001, 02:34 AM
#2
PowerPoster
If you are using Binary access, you shouldn't use the input statement. You should use Get instead. Try this:
VB Code:
Dim tfile As String
Dim ofile As String
Dim outfile As String
Dim intf As Long
Dim intf1 As Long
intf = FreeFile
tfile = "c:\temp\iii.hex"
intf = FreeFile
Private Sub Command1_Click()
Open tfile For Binary As #intf
Get #intf, , outfile
ofile = "c:\temp\177.hex"
intf1 = FreeFile
Open ofile For Binary As #intf1
put #intf1, , outfile
Close #intf1
Close #intf
End
End Sub
-
Aug 21st, 2001, 03:12 AM
#3
Fanatic Member
Why did you repost your question? It was already answered here by 3 people.
http://www.vbforums.com/showthread.php?threadid=97878
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
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
|