Int8

From Free Pascal wiki
Revision as of 07:39, 18 February 2020 by Trev (talk | contribs) (English translation of German page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Deutsch (de) English (en) français (fr)


Back to data types.


Range of values: -128 .. 127

Memory requirement: 1 byte or 8 bits

A data field of the Int8 data type can only accept integer values ​​with and without sign. Assigning other values ​​leads to compiler error messages when the program is compiled and the compilation process is aborted. That is, the executable program is not created.

Definition of a data field of type Int8:

  var 
    i8 : int8 ;

Examples of assigning valid values:

    i8 : = - 128 ;
    i8 : = 0 ;
    i8 : = 127 ;

Examples of assigning invalid values:

    i8 : = '-128' ;
    i8 : = '0' ;
    i8 : = '127' ;

The difference between the two examples is that the upper example is the assignment of literals of the type Integer, while the assignment of the lower example is literals of the type String.