It is recommended to choose important, commonly used explanations, and simultaneously operate, it is the best lecture method;
Data type
Integer type (Integer Type)
Patterns range format Shortint-128 ~ 127Singed 8-bitSmallint-32768 ~ 32767Singed 16-bitLongint-2147483648 ~ 2147483647Singed 32-bitByte0 ~ 255Unsigned 8-bitWord0 ~ 65535Unsigned 16-bitInteger-32768 ~ 32767Singed 16-bit
Real type (Real Type)
Type range floating point unit occupying memory space Real2.9e-39 ~ 1.7e38 11-126bytesingle1.5e-45 ~ 3.4e38 7-84 Bytedouble5.0e-324 ~ 1.7e308 15-168 Byteextended3.4e-4932 ~ 1.1 E4932 19-2010 BYTECOMP-263 1 ~ 263-1 19-208 Bytecurrency-922337203685477.5808 ~ -922337203685477.5807 19-208 BYTE
Boolean Type Bablin type information only two results, not true (true), usually in [0] representative, [1]
The representation of the CHAR & STRING TYPE niece is packed in single quotes, for example: '1', 'a', '!', 'Zyx', etc. There is also another representation of the "A '), the" ASCII code) string is the collection of the character, and the string of Delphi can accommodate 255 words: the declaration method str1: string [ 10] The length is 10 in parentheses [] encloses str2: string; length 255?
Array Type Arr1: Array [1..10] of integer; // 10 arrays of 10 intensive type elements Arr2: array ['a' .. 'Z'] of boolean; // 6 Boolean Array of type elements, index value 'a' to 'F'ARR1: array [1..5, 1..5] of real; // 25 real-type elements 2D array
• The elements in the recorded type array must be the same data, while the elements in the recorded state can be a collection of different data types typed = Recordyear: Word; // Year Word type Month: 1 ..12; // Month; 1 ~ 12 integer type DAY: 1..31; // days: 1 ~ 31 integer type END; after the previous declaration, Date has become a new data type We can use Date to declare a variable or array, such as: today: Date; ME [1..10]: Date;
• Collective (SET) collection data is also a collection of elements of the same data type, but the elements are not sequentially
• The indicator type indicator is a special data type, which represents a location where the information is located in the memory, not the content itself, the indicator indicator is ^ and @?
There are two types of file type files: one is type, and another is UNYPE. TYPED file: Composed of components of a single type; UNTYPE file: can consist of Typeaaaa = Record // by multiple types of components, declared AAA as a record type, declared that AAA became a new data type Name: String [10]; ID: INTEGER; PAY: DOUBLE; END; fileaa = file of aaa // Declaration file AAA is aaa type file type VARME: Fileaaa; me ^ .name: = 'Yang Zongzhi'; me ^ .id: = 123; me ^ .pay: = 555;
Variable
The declaration of variables: The declaration variable contains two parts, name and data type, for example: ME: Integer Me is a variable name; Integer is a variable ME data type principle: The first word must be English alphabet not to reserve word, symbol Or the identification name is not more than 127 fonts. It is not possible with the subscriber or function. There is no case in the same name without casement.
The classification variables of variables are divided into a domain or region declaration. The whole domain (Global) variables can be used by any program item, and the region (local) variable can only be used in the subscriber of the announcement. Not the variable declared in Procedure or Function is the whole country variable
? EXPRESSION
Calculator Operator Operator Operator Operator Description Operator Description Addition NOT Reverse - subtraction and * Multiplication OR or / Swantno XOR Mutual exclusion or DIV Merchant division SHL left shift MOD Retrafirus SHR right shift relationship 匴 匴 匴 集Operator = equal to intersection <> does not equal - difference set
Narrate
Direct narrative: Direct specification, such as: a: = 100; B: = C DGOTO Narration: Jumping Narrator Narrative: Used to call the programming Narration, that is, the subscription! Process Control Narrative Judgment: IF, Case Recycling Class: For, While, Repeat
IF THEN NR format: IF condition THENBEGIN ??????? Narrative block; end ;?
IF THEN ELSE Narrative Format: IF Condition THEN Narrative Block // The entire IF architecture is a narrative; ending ELSE narrative block; / / To this IF sequence calculation is completed?
Multi-selected case of narrative format: CASE evaluation value OF value 1: ??????? Narrative block; value 2: ??????? Narrative block; value 3: ?????? Block; end; evaluation value must be Integer, Char, enumeration state?
For do narrative format: for multi-variable variable: = initial value TO final value DOBEGIN ??????? Narrative block; end; format: for calculation variable: = initial value DOWNTO final value DOBEGIN ?????? ? Narrative block; END; TO is increasing loop (small to large); DOWNTO is a renewal ring (large to small)? While Doe narrative continues to perform the narrative round format: While Condition DOBEGIN ?? ????? Narrative block; END;
? REPEAT UNTIL describes the renewal ring until the conditional setup format: REPEAT narrative block; narrative block; Until conditional style;
TRY narrative
TRY EXCEPT TRY FINALLYTRY? STATEMENT A; Perform STATEMENT B EXCEPT? STATEMENT B;? End; Try Statement A;? End; "
Subscription
Declaration format:? Procedure Sootature Name (parameter 1: Data type, parameter 2: data type, ....) {Add to declaration or definition}? Begib {Sub-use content}? End; call subscription Do not need to use Call like VB
function
Declaration format: Function function name (parameter 1: data type, ....): Data type of the pass value? {Add a declaration or definition}? Begib {function content}? Function name: = arithmetic;? END ; Call: Variable name: = function name (actual parameter series);