[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 9.248 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

section 9.254 shr, section 8.3 Operators.

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html