Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Borland files from Visual Basic

Status
Not open for further replies.

Periko

Programmer
Feb 24, 2003
134
0
0
BE
Hello,

I have an urgent mather ! We have a program, developped in delphi 7.0 that writes to files (type : sequential).

I want to do sth with it from Visual Basic 6. Anyone an idea ?

I tried to view the data in debug-mode in a dos-box. I've seen e.g. after a string written, the hex 03 is there. Anyone having a description how this works or how I can write such a file structure. I have the structure on paper with me.

Greetzzzzzzzzz
Pedro...
 
Hi Pedro -

> I have an urgent mather ! We have a program, developped
> in delphi 7.0 that writes to files (type : sequential).

I don't know of a specific Pascal file type "sequential", other than a file created by a series of WriteLns or something, so can you explain the actual file type, and the file writing routines being used?

Do you have the source code to this program, or can you get a description of the output file format from the author?

> I want to do sth with it from Visual Basic 6. Anyone an idea ?

Basically any binary file created by any program written in any language can be read in any other language with it's own form of binary file access. So in VB you would "Open" as type Binary or something, and read X number of bytes at a time and print them or whatever.

To read a file of a particular record structure, you just need to create a structure of the corresponding variable types in VB and you should be able to read it correctly.

> I tried to view the data in debug-mode in a dos-box.

One recommendation, get V the File Viewer at www.fileviewer.com - it's 20 or 30 bucks to register, but you can use it in trial mode indefinitely with some feature limitations. It is a very flexible and powerful file viewer, which includes a hex viewing mode like that of DEBUG, but much more usable.

> I've seen e.g. after a string written, the hex 03 is there.

The hex 03 is probably part of the data of the next value after the string. Depending on how the data was written, a Pascal string sometimes starts with a "length" byte saying how many characters follow. So for example a string variable containing "Pedro" written to a file would come out as: 05 50 65 64 72 6F. Integers occupy four bytes, so a value of 3 would come out as: 03 00 00 00.

> Anyone having a description how this works or how I can
> write such a file structure. I have the structure on
> paper with me.

Do tell. If you can describe it in more detail, folks can be more specific in describing how to work with it.

- Xift
 
Correction - I wrote:
> get V the File Viewer at - it's 20 or 30 bucks to register,
> but you can use it in trial mode indefinitely with some feature limitations.

It's $20, and has a 60-day trial period. Still, it's highly worth it.

- Xift
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top