InputBP function (LotusScript® Language)

Reads a sequence of bytes (in the platform-native character set) from a sequential or binary file into a string variable without interpreting the input.


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


The number of bytes to read.


The number assigned to the file when it was opened.

Return value

The InputBP function returns a Variant, and InputBP$ 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 the number of Unicode characters that the bytes translate into. For example, 10 bytes of ASCII characters translate into 10 Unicode characters; 10 bytes of DBCS characters translate into 5 Unicode characters. If the last requested byte read is the lead byte of a DBCS character, the byte is dropped and the file pointer is positioned one byte before the last requested byte.

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


The input data is translated into Unicode.

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

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