Sign in Join
Wiki copytemporary

Typecast/de

Deutsch · English · Français · Русский

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 nach dem Casten 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)


From the Free Pascal wiki, page "Typecast/de", as it stood on 2016-06-13 after a change by FTurtle, 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.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.