Use byte-stream library routines to easily embed a file in a Vision file

0 Likes

Problem:

Need a simple way to embed a file in a Vision data file.

Resolution:

The byte-stream library routines (cbl_*_file) provide an easy way to embed files into a Vision data file.

Here are the basic steps:

1. cbl_open_file: Open the file.

2. cbl_read_file: Get the file information by using a special flag.

3. cbl_read_file: Read the file into working-storage.

That's it! Now simply write the data into the Vision file.

Attached is a sample program, imagetest.cbl, demonstrating how to embed an image file in a Vision file using this method.  Extracting the file from the Vision file is equally simple and is also demonstrated in the sample program.  Details of the various byte-stream routine parameters are noted in the source.  You will also find those details in the documentation for those routines.imagetest.zip

Comment List
Related
Recommended