manual:chapter6:libdata:cmd_binputb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
manual:chapter6:libdata:cmd_binputb [2019/10/30 15:13]
jojo1973
manual:chapter6:libdata:cmd_binputb [2021/09/20 09:41]
jojo1973 Redone
Line 1: Line 1:
 ==== BINPUTB ==== ==== BINPUTB ====
----- 
 <callout type="primary" color="" icon="fa fa-book" title="Synopsis"> <callout type="primary" color="" icon="fa fa-book" title="Synopsis">
 ---- ----
-Store bytes into binary data object+Store bytes into binary data container
 </callout> </callout>
  
Line 9: Line 8:
 ---- ----
 ^  __Input Stack__  ^^^^  ^  __Output Stack__  ^ ^  __Input Stack__  ^^^^  ^  __Output Stack__  ^
-|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **Num<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>new</sub>** +|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **Num<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>dest</sub>** 
-|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **S<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>new</sub>** +|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **S<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>dest</sub>** 
-|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **L<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>new</sub>** +|  **D<sub>dest</sub>**  |  **Num<sub>offset</sub>**  |  **L<sub>src</sub>**  |  **Num<sub>bytes</sub>**  |  **→**  |  **D<sub>dest</sub>** 
-|  //Level 4//  |  //Level 3//  |  //Level 2//  |  //Level 1//  |  //→//  |  //Level 1//  | +|  //Level 4//  |  //Level 3//  |  //Level 2//  |  //Level 1//  |  //→//  |  //Level 1//  |
  
 {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}} {{page>manual:chapter6:aux:legend&nofooter&noeditbtn&inline}}
  
-|**Type**| [[manual:chapter5:basics#commands|Command]]  || +| **Keyword type**  | [[manual:chapter5:basics#commands|Command]]  || 
-|**Parallel list processing**| [[manual:chapter5:listproc#group-7multiple-argument-one-result-commands|Group 7]]  ||  +| **Parallel list processing capabilities**  | [[manual:chapter5:listproc#group-7multiple-argument-one-result-commands|Group 7]]  | //Multiple argument, one result commands//  
-|**Affected by flags**| None  ||+| **Affected by flags**  //None//  || 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 + 
 </callout> </callout>
  
 <callout color="orangered" icon="fa fa-comment" title="Description"> <callout color="orangered" icon="fa fa-comment" title="Description">
 ---- ----
-The ''BINPUTB'' stores a specified number of bytes into a binary data container, starting from an offset position; it's not possible to write data exceeding the container's size.+The ''BINPUTB'' command stores a specified number of bytes 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: The source of data can be:
  
-  * a **scalar**: the number is converted to an unsigned binary integer and its lower 8 bits are replicated for a specified number of times into the data container; +  * a **scalar**: the number is converted to an unsigned binary integer and divided into bytes which are stored in the container, in __little endian byte order__
-  * a **string**: the string is converted to a stream of UTF8 codepoints whose lower 8 bits are written into the container; +  * a **string**: the string is converted to a stream of UTF8 codepoints whose lower 8 bits are stored into the container; 
-  * a **list of scalars**: each number is converted to a positive integer and its lower 8 bits are written into the container.+  * a **list of scalars**: each number is converted to an unsigned binary integer and its lower 8 bits are written in the container.
  
-If the size of the source data is less than the specified number of bytes the writing operation terminates silently without error.+If the size of the source data is less than the specified number of bytes remaining bytes will be set to ''#0h''.
 </callout> </callout>
  
 <callout type="danger" icon="true" title="Compatibility"> <callout type="danger" icon="true" title="Compatibility">
 ---- ----
-This command is new in newRPL and does not exist in userRPL.+''BINPUTB'' is specific to **newRPL** and has no direct equivalent in **userRPL**.
 </callout> </callout>
  
 <callout type="info" icon="true" title="Usage"> <callout type="info" icon="true" title="Usage">
 ---- ----
 +**__Input__**
 <code> <code>
-4:              BINDATA 1 A4gACz +4:                BINDATA 2 AAAAAAAAAAAA 
-3:                             +3:                                     
-2:                             0 +2:                    #1122334455667788h 
-1:                             4 +1:                                     8 
-…………………………………………………………………………………… +………………………………………………………………………………………………………… 
-BINPUTB+BINPUTB                                 
 </code> </code>
-where level 4 stores a binary data container of size 4, will result in+\\ 
 +**__Output__**
 <code> <code>
-1:              BINDATA 1 AAAAAA +4:                                       
-…………………………………………………………………………………… +3:                                       
 +2:                                       
 +1:                BINDATA 2 VWZ3iYESIzR4 
 +………………………………………………………………………………………………………… 
 +                                        
 </code> </code>
-a data container totally empty. 
 </callout> </callout>
  
Line 62: Line 79:
 {{page>manual:chapter6:libdata&nofooter&noeditbtn&inline}} {{page>manual:chapter6:libdata&nofooter&noeditbtn&inline}}
 </callout> </callout>
 +
  • manual/chapter6/libdata/cmd_binputb.txt
  • Last modified: 2021/09/23 00:44
  • by jojo1973