Returns a binary format that reads a sequence of items and returns a list.
function (
binaryFormat
as function, optionalcountOrCondition
as nullable any) as function
Returns a binary format that reads a sequence of items and returns a list
. The binaryFormat
parameter specifies the binary format of each item. There are three ways to determine the number of items read:
Binary Formats.Reading lists
Read bytes until the end of the data.
letbinaryData = #binary({1, 2, 3}),listFormat = BinaryFormat.List(BinaryFormat.Byte)inlistFormat(binaryData)
{1, 2, 3}
Read two bytes.
letbinaryData = #binary({1, 2, 3}),listFormat = BinaryFormat.List(BinaryFormat.Byte, 2)inlistFormat(binaryData)
{1, 2}
Read bytes until the byte value is greater than or equal to two.
letbinaryData = #binary({1, 2, 3}),listFormat = BinaryFormat.List(BinaryFormat.Byte, (x) => x < 2)inlistFormat(binaryData)
{1, 2}