- - , , - -, .
. .
.
1
, , . 1.
. 1.
:.
, (TEdit), String, .
, - .
-.
- , ( TButton).
.
:
;
;
;
;
- -;
TButon;
ShowMessage.
.
1
, | |||
Shortint | -128..127 | ||
Smallint | -32768.. 32767 | ||
Integer* | -2147483648..2147483647 | ||
Longint | -2147483648..2147483647 | ||
64 | Int64 | -263.. 263-1 | |
Byte | 0..255 | ||
Word | 0..65535 | ||
Cardinal* | 0..4294967295 | ||
Longword | 0..4294967295 |
2
, | |||
Single | 1,510-45..3,41038 | ||
Real48 | 2,910-39..1,71038 | ||
Real* | 5,010-324..1,710308 | ||
Double | 5,010-324..1,710308 | ||
Comp | -263+1.. 263-1 | ||
Extended | 3,610-4932..1,1104932 | ||
Currency | -922337203685477.5808.. 922337203685477.5807 |
* 32-bit . (Double) 16-bit .
|
|
+, -, *, / - .
div - - .
mod , .
. , . . (/) .
2
+ | ||
- | ||
* | ||
/ | ||
div | ||
mod |
- .
:
, , 0 256;
;
.
Type <_> = set of < >;
<_> - ;
set, of - (, );
< > - ,
, Word, Integer,
Longint, Int64.
: , ; . , - .
{ }
Type digitChar = set of '0'..'9'; // 0 9
digit = set of 0..9; // 0 9
Var
sl, s2: digitChar; //-
s4: digit;
begin { }
s1:= ['1', '2', '3']; // -
s2:= [ ]; //
s4:= [0..3, 6]; // 0 3 6
:
* ; , ;
+ ; , ;
- ; , ;
= , True, ;
<> , True, ;
<= , True, ;
|
|
>= , True, ;
in - , - , ; True, , .
.
include(S,I) - ; s - , I , .
exclude(S,I) - .
IF
If Case.
3
IF
If then 1 else 2; | = 1, - 2 | If then ; | = | |||||||
|
| |||||||||
If :
If, then, else - (, , );
- , True False;
- , If Begin... end.
Begin... end :
If then begin 1; ....... N end else ; | If then else begin 1; ....... N end; | If then begin 1.1; ....... 1.N end else begin 2.1; ....... 2.M end; |
, If, , , . - True False.
4
= | <> | < | <= | > | >= | |
. | . |
5
()
not A | A and B | A or B | A xor B | ||
A | B | ||||
True | True | False | True | True | False |
True | False | False | False | True | True |
False | True | True | False | True | True |
False | False | True | False | False | False |
. () : +, -, not; - *, /, div, mod, and; - +, -, or, xor; () - .
, If.
2 |
True |
1 |
False |
1 |
2 |
3 |
True |
If 1
then if 2
then 1
else 2
else 3;
False |
2 |
2 |
1 |
1 |
3 |
False |
If 1
then 1
else if 2
then 2
else 3;