Delphi Learning Notes (1) -Object Pascal Language Data Type Select Blog from XMZ2629

xiaoxiao2021-03-06  41

I have learned more than ten days of Delphi, I feel that this is easy to apply. Summarize the most basic knowledge here. I. Data type: (1) Basic data type: a, integer type: (General type <32 digits>: integer- Symbol; cardinal- unsigned) specific: Sign: Shortint <8>, Smallint <16 >, Longint <32-bit> No Symbol: Byte <8-bit>, Word <16-bit>, LongiWord <32-bit> B, Character Type: (General Type <8>: Char - with Ansichar) Specific: Ansichar < 8-bit>: Mainly stores ANSI character widechar <16-bit>: Mainly store Unicode Character C, Boolean: (General Type <8>: Boolean- with ByteBool) Specific: Bytebool <8>, WordBool <16> LongBool <32-bit> Different Boolean types are mainly used for other programming languages ​​and different Windows systems. d, Enumeration Type: Definition: TYPE Enumeration Type Identifier = (Key1 [= VAL1], ...., Keyn [= VALN]): N <= 255 If you specify a value for some Key, no specified The value of the key is the previous key value plus 1; if all the defaults are not specified, the key1 value is 0, and 1 will be added one by one. E, subjuntet type: Definition: TYPE sub-boundary type identifier = lower bound. . The lower bound is as: Type Subint = 1. . 3 0; represents an integer type subchar = 'A' of 1 to 30. . 'Z'; indicating the character ※ Note: 1, the above four types are called an ordered type, that is, in addition to the number of first lines, except for the last number, there is a post number. Here (in the computer), the integer is limited. The number of ordered types has a serial number called the order. The number of integers is itself, and the first number of other types is 0, which is incremented. 2, on the sub-boundary type, the lower bound must have the same ordered type, and the upper order is greater than the lower sequence.

f, floating point type: (General type <8 bytes>: real- with double equivalents) specific: double <8 bytes>, Real48 <6 bytes> Single <4 bytes>, Extended <10 bytes>, Comp <8 bytes>, Currency <8 bytes> G, String Type: (General Type: String- and Ansistring) Specific: Shortstring: Most of the 255 characters, the first one stores characters, not NULL End ANSISTRING: Store the ANSI character, with NULL ends WideString: Store the Unicode character, at the end of NULL H, time, date type: TDATETIME - Appearance of the floating point type (2) Complex data type: a, pointer type: definition: definition: Type pointer type identifier = ^ Basic type The basic type is used: The pointer type identifier ^ actually uses the pointer: VAR variable identifier: ^ Basic type; after the variable allocation can be used as a normal variable.

转载请注明原文地址:https://www.9cbs.com/read-53548.html

New Post(0)