Node: shl, Next: ShortBool, Previous: SetType, Up: Reference

### shl

#### Synopsis

         operator shl (operand1, operand2: integer_type) = Result: integer_type;

or

         procedure shl (var operand1: integer_type; operand2: integer_type);

#### Description

In GNU Pascal, `shl` has two built-in meanings:

1. Bitwise shift left of an integer-type expression by another integer value. The result is of the type of the first operand.
2. Use as a “procedure”: `operand1` is shifted left by `operand2`; the result is stored in `operand1`.

#### Conforming to

`shl` is a Borland Pascal extension.

Use of `shl` as a “procedure” is a GNU Pascal extension.

#### Example

         program ShlDemo;
         var
           a: Integer;
         begin
           a := 1 shl 7;  { yields 128 = 2 pow 7 }
           shl (a, 4)  { same as `a := a shl 4' }
         end.

#### See also

Keywords, shr, Operators.