This is an old revision of the document!
BINPUTW
Synopsis
Store 32-bit words into binary data object
Description
The BINPUTW
stores a specified number of 32 bits words into a binary data container, starting from an offset position; it's not possible to write data exceeding the container's size.
The source of data can be:
- a scalar: the number is converted to an unsigned binary integer and its lower 32 bits are replicated in little endian format for a specified number of times into the data container;
- a string: the string is converted to a stream of UTF8 codepoints whose lower 8 bits are left padded to 32 bits and written in little endian format into the container;
- a list of scalars: each number is converted to a positive integer and its lower 32 bits are written in little endian format into the container.
If the size of the source data is less than the specified number of words the writing operation terminates silently without error.
Compatibility
This command is new in newRPL and does not exist in userRPL.
Usage
4: BINDATA 1 AYNcEw 3: 0 2: "X" 1: 1 …………………………………………………………………………………… BINPUTW
where level 4 stores a binary data container of size 4, will result in
1: BINDATA 1 AAAAWQ ……………………………………………………………………………………
a data container storing bytes { #58h #0h #0h #0h }
in positions from 0 to 3.
Related Commands
Command | Short Description | |
---|---|---|
MKBINDATA | Create binary data container object | NEW |
BINPUTB | Store bytes into binary data object | NEW |
BINGETB | Extract binary data as list of bytes | NEW |
BINPUTW | Store 32-bit words into binary data object | NEW |
BINGETW | Extract data from a binary data object as a list of 32-bit words | NEW |
BINPUTOBJ | Store an entire object into a binary data container | NEW |
BINGETOBJ | Extract an entire object from a binary data container | NEW |
BINMOVB | Copy binary data block into a binary data object | NEW |
BINMOVW | Copy 32-bit words between binary data objects | NEW |