VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Bit IO

Derek Haas  (4 Submissions)   Files/File Controls/Input/Output   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

This module allows you to view a file as a collection of bits rather than as a collection of bytes. It allows you to read/write a single bit at a time or read/write up to 32 bits at once.

Inputs
It's all explained in the code

Returns
Same as above

Side Effects
Don't try writing to a file opened for reading, and don't try reading from a file opened for writing - there is no error checking for that and the results are unpredictable. Don't try to read or write more than 32 bits at a time with the InputBits and OutputBits functions. If you try to write a value with less bits than that value requires, the correct value will not be written. For example, don't try to write the value 32 into a file using only 4 bits. After every call to inputbits and inputbit, you should check for eof on the input file using this code: 'inputbit/inputbits call here if eof(bitfile.filenum) = True then 'replace bitfile with the name of the variable 'put code to exit loop or leave function here end if

Rate Bit IO (2(2 Vote))
Bit IO.bas

Bit IO Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters