BinaryOccurrence.Repeating

BinaryOccurrence.Repeating (2) is an enumeration that specifies how many times the item is expected to appear in the group. It is a member of the BinaryOccurrence.Type and specifies the item appearing zero or more times in the input.

Examples

// The following example returns {11, {22, 22}, null, {}}
let
    b = #binary( { 1, 11, 2, 22, 2, 22, 5, 55, 1, 11 } ),
    f = BinaryFormat.Group( 
           BinaryFormat.Byte,
           {
               {1, BinaryFormat.Byte, BinaryOccurrence.Required},
               {2, BinaryFormat.Byte, BinaryOccurrence.Repeating},
               {3, BinaryFormat.Byte, BinaryOccurrence.Optional},
               {4, BinaryFormat.Byte, BinaryOccurrence.Repeating}
           },
           ( extra ) => BinaryFormat.Byte
        )
in
    f( b )

Other related enumerations are:

Applies to

Here’s a list of functions that work with BinaryOccurrence.Type:

BI Gorilla Blog

Last update: August 17, 2023 | Contribute » | Contributors: Rick de Groot
© 2023 BI Gorilla. All rights reserved. Content derived from Microsoft documentation is property of Microsoft Corp.