CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Aug 2004
    Posts
    3

    How to get byte position? [Resolved]

    Hi, everyone!
    I'm newbie of course
    Here is my problem.I want to search some text in binary file (created by me).So far, so good. But when I try to get byte position for searched string - nothings happen.Here is my code:

    Dim strFile As String
    Dim bytPos As Byte
    Dim lngTelPos As Long
    Open "example.ran" For Binary Access Read Lock Read Write As #1
    strFile = Input(LOF(1), #1)
    bytPos = InStr(1, strFile, strName)
    lngTelPos = Loc(1)
    If bytPos > 0 Then
    Get #1, lngTelPos + 1, strTel
    a = MsgBox(...)
    Else
    a = MsgBox(...)
    End If
    Close #1
    Last edited by bilidim; August 11th, 2004 at 06:28 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
  •  





Click Here to Expand Forum to Full Width

Featured