Skip to main content

BinaryFormat.Transform

ส่งกลับรูปแบบไบนารีที่จะแปลงค่าที่อ่านโดยค่าไบนารีอื่น

Syntax​

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

Remarks​

ส่งกลับรูปแบบไบนารีที่จะแปลงค่าที่อ่านโดยค่าไบนารีอื่น พารามิเตอร์ binaryFormat จะระบุรูปแบบไบนารีที่จะถูกใช้เพื่ออ่านค่า function จะถูกเรียกด้วยค่าที่ถูกอ่าน และส่งกลับค่าที่ถูกแปลง

Examples​

Example #1​

อ่านไบต์และเพิ่มลงในพารามิเตอร์

let
binaryData = #binary({1}),
transformFormat = BinaryFormat.Transform(
BinaryFormat.Byte,
(x) => x + 1
)
in
transformFormat(binaryData)

Result:

2

Category​

Binary Formats.Transforming what was read