Binary Put/Get for Strings (with Unicode)

Category:
Files and Directories
Type:
Snippets
Difficulty:
Intermediate
Author:
Roman Bobik

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
These functions allow you to write and read (put/get) strings to/from a file opened in binary-mode. A unicode-version is also included. All functions let you specify if you want to use a integer or long length-descriptor. If you choose integer the resulting file will be 2 bytes shorter than choosing long, but the string can only be 2^15-1 Bytes long.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: