Extracting variable sized strings from binary file

L

luis

I need to extract strings from a binary file with the following format

INT-STRING-INT_STRING-INT-STRING-..........

where the integer is the length of the string.

I want to make a function that does what this failed attempt yearns...


Public Function svString(ByVal FileNo As Integer, Cursor As Integer) As
String
Dim sze As Integer
sze = 10
Get #FileNo, Cursor, sze ' Get string len
Dim svString As String * sze
Get #FileNo, Cursor + 4, svString ' Get string
End Function


The problem is declaring an array whith a variable (has to be constant)
can anybody provide tips ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top