BinaryFormat.Choice

This function returns a binary format that dynamically selects the next binary format based on a previously obtained value. The process follows these steps: 1. Use the binary format specified by the ...

Syntax

BinaryFormat.Choice(binaryFormat as function, chooseFunction as function, optional type as nullable type, optional combineFunction as nullable function) as function

About

This function returns a binary format that dynamically selects the next binary format based on a previously obtained value. The process follows these steps: 1. Use the binary format specified by the binaryFormat parameter to read a value. 2. Pass the value to the choice function specified by the chooseFunction parameter. 3. The choice function evaluates the value and returns a second binary format. 4. Use the second binary format to read a second value. 5. If the combine function is provided, both the first and second values are passed to it for processing, and the resulting value is returned. 6. If the combine function is not provided, the second value is returned. 7. The final value is returned. An optional type parameter can be utilized to specify the type of binary format that will be returned by the choice function. The options include type any, type list, or type binary. If the type parameter is omitted, type any is assumed. When type list or type binary is selected, the system has the potential to r