Table of contents
TOC
Collapse the table of content
Expand the table of content

BinaryFormat.Transform

Owen Duncan|Last Updated: 4/19/2018

About

Returns a binary format that will transform the values read by another binary format.

BinaryFormat.Transform(binaryFormat as function, transform as function) as function  

Arguments

ArgumentDescription
binaryFormatThe binary format that will be used to read the value.
transformInvoked with the value read, and returns the transformed value.

Example

// Read a byte and add one to it.  
let      
binaryData = #binary({1}),      
transformFormat = BinaryFormat.Transform(          
BinaryFormat.Byte,          
(x) => x + 1)  
in  
transformFormat(binaryData)   
equals 2  
© 2018 Microsoft