Difference between revisions of "Typecast/de"
From Lazarus wiki
Jump to navigationJump to searchLine 24: | Line 24: | ||
<td>Real</td> | <td>Real</td> | ||
<td>Integer</td> | <td>Integer</td> | ||
− | <td>explicit< | + | <td>explicit<br>Nachkommastellen abschneiden<br>kaufm. Runden</td> |
− | + | <td><br>Trunc<br>Round</td> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <td>< | ||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 49: | Line 37: | ||
<td>String</td> | <td>String</td> | ||
<td>explicit</td> | <td>explicit</td> | ||
− | <td>FloatToStr< | + | <td>FloatToStr<br>FloatToStrF</td> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 73: | Line 55: | ||
<td>String</td> | <td>String</td> | ||
<td>Char</td> | <td>Char</td> | ||
− | <td>explicit< | + | <td>explicit<br>Zugriff über Index</td> |
− | + | <td>keine<br>keine</td> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <td>keine</td> | ||
</tr> | </tr> | ||
<tr> | <tr> |
Revision as of 10:25, 21 October 2012
│
Deutsch (de) │
English (en) │
français (fr) │
русский (ru) │
Die Typumwandlung von Werten aus Variablen mit niederwertigen Datentyp in Variablen mit höherwertigen Datentyp geht automatisch (implizit).
Wird ein Wert von einer Variable von einem höherwertigen Datentyp in eine Variable mit einem niederwertigen Datentyp umgewandelt (gecastet) und ist in der Variable vom höherwertigen Datentyp ein Wert, der nicht in die Variable vom Zieldatentyp passt,
dann stehen in der Variable vom Zieldatentyp falsche Werte.
Typumwandlung
von Datentypgruppe | nach Datentypgruppe | Art der Typumwandlung | Funktion |
Integer | Real | implizit | keine |
Real | Integer | explicit Nachkommastellen abschneiden kaufm. Runden |
Trunc Round |
Integer | String | explicit | IntToStr |
Real | String | explicit | FloatToStr FloatToStrF |
String | Integer | explicit | StrToInt |
String | Real | explicit | StrToFloat |
String | Char | explicit Zugriff über Index |
keine keine |
Char | String | implizit | keine |
von Datentyp | nach Datentyp | Art der Typumwandlung | Funktion |
QWord | Byte | explicit | Byte(QWord) |
QWord | Word | explicit | Word(QWord) |
QWord | Cardinal | explicit | Cardinal(QWord) |
QWord | Longword | explicit | Longword(QWord) |
Longword | Byte | explicit | Byte(Longword) |
Longword | Word | explicit | Word(Longword) |
Longword | Cardinal | implicit (einfache Wertzuweisung) | |
usw. | |||
Int64 | Byte | explicit | Byte(Int64) |
usw. | |||
Int64 | Shortint | explicit | Shortint(Int64) |
usw. | |||
Comp | Byte | explicit | Byte(Comp) |
usw. | |||
Comp | Shortint | explicit | Shortint(Comp) |
usw. | |||
Comp | Real | explicit | Real(Comp) |
usw. |
--Olaf 08:07, 21 October 2012 (UTC)