InputB function (LotusScript® Language)

Reads a sequence of bytes from a sequential or binary file into a string variable without interpreting the input.


InputB[$] ( count , [#]fileNumber )


The number of bytes to read.


The number assigned to the file when it was opened.

Return value

The InputB function returns a Variant, and InputB$ returns a String.

LotusScript® returns the specified number of bytes, beginning at the current position within the file. If you request more bytes than are available, LotusScript® generates an error.

The length of the returned string (measured in characters, as computed by the Len function) is (# bytes returned) / 2 if an even number of bytes is returned, and otherwise (# bytes returned + 1) / 2, if an odd number of bytes is returned. If an odd number of bytes is returned, then the last character in the returned string is padded with a 0 byte.

If count is 0, LotusScript® returns the empty string ("").


The input data is not filtered or translated in any way. All bytes are returned, including the bytes representing newline, quotation marks, and space.

If you want to work with characters instead of bytes, use the Input or Input$ function.

You cannot use the Input, Input$, InputB, or InputB$ function to read a file opened in Output, Append, or Random mode.