SHLB - Shift left buffer

Language reference ›› Built-in procedures ›› Miscellaneous variable treatments ››
Parent Previous Next

SHLB(destination, source) NEW! (V2.0)        

Shift <destination> left by one position, inserting <source> to LSB.


<destination> may be any variable of type CHAR, BYTE, WORD, LONGWORD, SHORTINT, INTEGER, LONGINT, or an ARRAY of these types, or an ARRAY of BOOLEAN; in this last case, the number of elements must be multiple of 8.

<source> may be any variable of type BOOLEAN, CHAR,  BYTE, WORD, LONGWORD, SHORTINT, INTEGER, LONGINT; if non-boolean, only the LSB will be moved (bit 0).

The variables cannot be pointers nor located in EEPROM.

 TheBuf: ARRAY[1..5] OF BYTE;

 // Shift in the buffer to the left, insert into LSB
 SHLB(TheBuf, TheBit);

See also: SHLB function.