maxint/de: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: maxint/de
| Old | New | Line | |
|---|---|---|---|
| 1 | + | MAXINT ist eine globale Konstante. Ihr Wert entspricht nach ISO 7185 dem maximalen positiven Wert, der in einem Datenfeld vom Datentyp-Integer gespeichert werden kann.\ | |
| 2 | + | ||
| 3 | + | Das folgende Beispiel einer Konsolen- / Terminal-Anwendung zeigt wie diese Werte auf dem verwendeten System belegt sind: | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | program maxvals; | |
| 7 | + | {$mode objfpc}{$H+} | |
| 8 | + | {$IMPLICITEXCEPTIONS OFF} | |
| 9 | + | ||
| 10 | + | const | |
| 11 | + | Width = 45; | |
| 12 | + | ||
| 13 | + | begin | |
| 14 | + | writeln; | |
| 15 | + | writeln('Diese Werte sind vom Compiler-Modus abhaengig:'); | |
| 16 | + | writeln('----------------------------------------------------------------'); | |
| 17 | + | // Die Konstante MaxInt | |
| 18 | + | writeln('maxint: :', maxint: Width); | |
| 19 | + | // Ermittlung des höchtmöglichen positiven Wertes der Variablen Integer | |
| 20 | + | writeln('high( integer ) :', high(integer): Width); | |
| 21 | + | writeln; | |
| 22 | + | writeln('Diese Variablen beispielsweise haben eine andere, feste Groesse: '); | |
| 23 | + | writeln('----------------------------------------------------------------'); | |
| 24 | + | // Ermittlung des höchtmöglichen positiven Wertes der Variablen Int8 | |
| 25 | + | writeln('high( int8 ) :', high(int8): Width); | |
| 26 | + | // Ermittlung des höchtmöglichen positiven Wertes der Variablen Int16 | |
| 27 | + | writeln('high( int16 ) :', high(int16): Width); | |
| 28 | + | // Ermittlung des höchtmöglichen positiven Wertes der Variablen Int32 | |
| 29 | + | writeln('high( int32 ) :', high(int32): Width); | |
| 30 | + | // Ermittlung des höchtmöglichen positiven Wertes der Variablen Int64 | |
| 31 | + | writeln('high( int64 ) :', high(int64): Width); | |
| 32 | + | writeln; | |
| 33 | + | writeln('----------------------------------------------------------------'); | |
| 34 | + | // Ermittlung der aktuellen CPU | |
| 35 | + | Write('Verwendete CPU :'); | |
| 36 | + | // Bedingte Compilierung - Anfang | |
| 37 | + | {$IFDEF cpu64} | |
| 38 | + | Writeln('cpu64': Width); | |
| 39 | + | {$ENDIF} | |
| 40 | + | {$IFDEF cpu32} | |
| 41 | + | Writeln('cpu32': Width); | |
| 42 | + | {$ENDIF} | |
| 43 | + | {$IFDEF cpu16} | |
| 44 | + | Writeln('cpu16': Width); | |
| 45 | + | {$ENDIF} | |
| 46 | + | // Bedingte Compilierung - Ende | |
| 47 | + | writeln; | |
| 48 | + | writeln; | |
| 49 | + | end. | |
| 50 | + | ``` | |
| 51 | + | ||
| 52 | + | --Olaf 20:13, 2 December 2013 (CET) | |
| 53 | + | ||
| 54 | + | --- | |
| 55 | + | *From the Free Pascal wiki, page "maxint/de", as it stood on 2020-02-20 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
