Returns a binary format that chooses the next binary format based on a value that has already been read. The binary format ...

Returns a binary format that chooses the next binary format based on a value that has already been read.  The binary format value produced by this function works in stages:
  • The binary format specified by the {0} parameter is used to read a value.
  • The value is passed to the choice function specified by the {1} parameter.
  • The choice function inspects the value and returns a second binary format.
  • The second binary format is used to read a second value.
  • If the combine function is specified, then the first and second values are passed to the combine function, and the resulting value is returned.
  • If the combine function is not specified, the second value is returned.
  • The second value is returned.
The optional {2} parameter indicates the type of binary format that will be returned by the choice function. Either type any, type list, or type binary may be specified. If the {2} parameter is not specified, then type any is used. If type list or type binary is used, then the system may be able to return a streaming binary or list value instead of a buffered one, which may reduce the amount of memory necessary to read the format.