-
NET -> Basic Help
In VB6 what would be the equivlant functions for these?
Dim tmp As New StringBuilder
Dim f = FreeFile()
FileOpen(f, strPath, OpenMode.Binary, OpenAccess.Read)
Dim StrLoc As String = InputString(f, LOF(f))
-
Dim f As Integer
Dim strLoc As String
f = FreeFile
Open strPath For Input As f
strLoc = Input(LOF(f), f)
Close f
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
 Originally Posted by Phil Weber
Dim f As Integer
Dim strLoc As String
f = FreeFile
Open strPath For Input As f
strLoc = Input(LOF(f), f)
Close f
Run-time error '62'
Input past end of file
-
Hmm, that doesn't make sense. LOF = length of file. You're saying, "Read length-of-file bytes from file handle f into variable strLoc." How can it read past the end of the file if you ask for length-of-file bytes?
Try changing:
Open strPath For Input As f
to:
Open strPath For Binary As f
and see if that makes a difference.
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
There has to be something else going on here. This work just fine for me.
Code:
Private Sub Command1_Click()
Dim f As Integer
Dim strLoc As String
Dim strPath As String
strPath = "d:\devtest.txt"
f = FreeFile
Open strPath For Input As f
strLoc = Input(LOF(f), f)
Close f
End Sub
-
Phil is right.
Code:
FileOpen(f, strPath, OpenMode.Binary, OpenAccess.Read)
in VB 6.0 mean
Code:
Open strPath For Binary As f
HTH
Similar Threads
-
Replies: 1
Last Post: 06-13-2008, 08:11 AM
-
By Branta in forum Careers
Replies: 0
Last Post: 06-29-2005, 04:30 PM
-
By Robert Lantry in forum .NET
Replies: 88
Last Post: 04-05-2002, 08:03 AM
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
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|