$typedAddress/de: what changed
Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | 1 | Zurück zu den [[local compiler directives/de|lokalen Compilerdirektiven]] | |
| 4 | 2 | ||
| 5 | - | ||
| 3 | + | ## \$TYPEDADDRESS und \$T | |
| 6 | 4 | ||
| 7 | - | ||
| 5 | + | Die Compilerdirektive \$TYPEDADDRESS und \$T sind in Ihrer Verwendung Synonym.\ | |
| 6 | + | Die Compilerdirektive \$TYPEDADDRESS, legt fest, ob der Operator @ (Adressoperator) einen typisierten oder einen untypisierten Pointer zurück gibt.\ | |
| 7 | + | Die Compilerdirektive \$T kennt zwei Schalter + und -.\ | |
| 8 | + | Die Compilerdirektive \$TYPEDADDRESS kennt zwei Schalter ON und OFF.\ | |
| 8 | 9 | ||
| 9 | - | ||
| 10 | - | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | ||
| 10 | + | Beispiel für einen Fehler: | |
| 11 | + | ||
| 12 | + | {$T+} // schaltet den typisierten Pointer ein | |
| 17 | 13 | ||
| 18 | 14 | Var | |
| 19 | - | ||
| 20 | - | ||
| 15 | + | I : Integer; | |
| 16 | + | P : PChar; | |
| 21 | 17 | ||
| 22 | 18 | begin | |
| 23 | 19 | P:=@I; | |
| 24 | 20 | // Der Compiler gibt folgende Fehlermeldung aus: | |
| 25 | - | ||
| 21 | + | // ... : Incompatible types: got "^SmallInt" expected "PChar" | |
| 26 | 22 | end. | |
| 27 | - | ||
| 28 | 23 | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - | ||
| 24 | + | In der Standardeinstellung übergibt der Adressoperator einen untypisierten Pointer.\ | |
| 25 | + | ||
| 26 | + | Beispiel: | |
| 27 | + | ||
| 28 | + | {$T-} // Die Standardeinstellung schaltet den typisierten Pointer aus | |
| 29 | + | ||
| 36 | 30 | Var | |
| 37 | - | ||
| 38 | - | ||
| 31 | + | I : Integer; | |
| 32 | + | P : PChar; | |
| 39 | 33 | ||
| 40 | 34 | begin | |
| 41 | 35 | P:=@I; | |
| 42 | 36 | // Der Compiler gibt keine Fehlermeldung aus | |
| 43 | 37 | end. | |
| 44 | - | ||
| 45 | 38 | ||
| 46 | - | ||
| 47 | - | ||
| 48 | - | ||
| 39 | + | --Olaf 09:05, 25 January 2013 (UTC) | |
| 49 | 40 | ||
| 50 | 41 | --- | |
| 51 | - | ||
| 42 | + | *From the Free Pascal wiki, page "$typedAddress/de", as it stood on 2023-03-05 after a change by Kai Burghardt, 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).* | |
| 43 | + | Category: Free Pascal Programmers Guide/de |
