Delphi4 Object Pascal language guide

Read or Download Delphi4 Object Pascal language guide PDF

Similar programming: programming languages books

Objektorientierte Programmiersprache C++: Vollständige Einführung anhand von Beispielen (VDI-Buch) (German Edition)

In diesem Werk werden alle Aspekte der Sprache C++ behandelt, deshalb ist das Buch ebenso für Einsteiger, mit oder ohne Vorkenntnisse über eine andere Programmiersprache, als auch für Umsteiger von anderen Programmiersprachen bzw. C-Programmierer geeignet. Die Darstellung der Sachverhalte erfolgt knapp und systematisch, die Beispiele sind kurz, prägnant und compiler- unabhängig und auf allen Rechnern mit C++ 2.

Extra info for Delphi4 Object Pascal language guide

Example text

This may involve truncation or extension if the size of the specified type differs from that of the expression. The expression’s sign is always preserved. The statement 4-14 Object Pascal Language Guide Expressions I := Integer('A'); assigns the value of Integer('A')—that is, 65—to the variable I. A value typecast cannot be followed by qualifiers and cannot appear on the left side of an assignment statement. Variable typecasts You can cast any variable to any type, provided their sizes are the same and you do not mix integers with reals.

The others exist to provide compatibility with different languages and the Windows environment. A Boolean variable occupies one byte of memory, a ByteBool variable also occupies one byte, a WordBool variable occupies two bytes (one word), and a LongBool variable occupies four bytes (two words). Boolean values are denoted by the predefined constants True and False. The following relationships hold. Boolean ByteBool, WordBool, LongBool False < True False <> True Ord(False) = 0 Ord(False) = 0 Ord(True) = 1 Ord(True) <> 0 Succ(False) = True Succ(False) = True Pred(True) = False Pred(False) = True A value of type ByteBool, LongBool, or WordBool is considered True when its ordinality is nonzero.

A string constant of length 1, such as 'A', can denote a character value. The predefined function Chr returns the character value for any integer in the range of AnsiChar or WideChar; for example, Chr(65) returns the letter A. Character values, like integers, wrap around when decremented or incremented past the beginning or end of their range (unless range-checking is enabled). For example, after execution of the code var Letter: Char; I: Integer; begin Letter := High(Letter); for I := 1 to 66 do Inc(Letter); end; Letter has the value A (ASCII 65).

Download PDF sample

Rated 4.62 of 5 – based on 7 votes