ProcedureConcateStrings;
Var
myString1, myString2, myAlphabet: string;
Implementation
procedureConcateStrings;
Begin
myString 1:= ABCs ;
myString 2:= is + alphabet!;
myAlphabet:= myString 1+ myString 2;
myAlphabet
// ABCs is alphabet!
showMessage(myAlphabet);
myAlphabet:=AnsiUpperCase(myAlphabet);
myAlphabet
// ABCS IS ALPHABET!
showMessage(myAlphabet);
end;
(record):
. INTERFACE TYPE. :
Type
TPersonalData = record
phoneNumber: string;
personal_Id: integer;
position: string;
End;
TYPE TPersonalData , = record. , , . , . , .
ProcedureWorkWithStructure;
Type
TPersonalData = record
phoneNumber: string;
personal_Id: integer;
position: string;
End;
Var
VasyaData: TPersonalData;
LenaData: TPersonalData;
Begin
vasyaData.phoneNumber:=8-999-500-25-25;
vasyaData.personal_id:=666;
vasyaData.position:= - ;
lenaData.phoneNumber:=8-999-500-24-25;
lenaData.personal_id:=2000+150+5; //2155
lenaData. position:= + ;
End;
:
́ ́ (. statement) ; . .
. , . .
1) INTEGER
a) + -
b) -- -
c) * -
d) Div
|
|
e) Mod
f) = -
g) <> -
2) FLOAT
a) +
b)
c) *
d) /
e) Pow(f,base) () //f:=pow(10,3); f = 1000
f) =
g) <>
3) String // s:=My String; s1:=s[9] = g
a) + - ()
b) [ n ] n.
c) =
d) <>
4) Boolean
a) AND ()
b) OR ()
c) NOT
d) =
e) XOR NOT(OR())
f) <>
:= = <> .
B1, b2, b3: Boolean;
B1:=true; b2:=false;
B3:=b1 andb2; //false
B1 b2 b3 b1 b2 b3 b1 res
AND 1 0 0 OR 1 1 1 NOT 1 0
1 1 1 1 0 1 0 1
0 1 0 0 1 1
0 0 0 0 0 0
B1 b2 b3 b1 b2 b3
= 1 1 1 <> 1 1 0
1 0 0 1 0 1
0 1 0 0 1 1
0 0 1 0 0 0
():
, . . .
, , .
Delphi procedure. function. INTERFACE. .
Procedure [ ] ();
Function [ ](): ;
UnitMyMethods;
Interface
Uses
Dialogs, SysUtils;
Procedure HelloWorld;
Function WhatDate: string;
Implementation
Procedure HelloWorld;
Begin
showMessage(Hello, World!);
End;
Function WhatDate: string;
I: double;
Begin
Result:=dateToStr(Date);
End;
End;
UnitMyProject;
Uses
Windows, Messages, SysUtils, Classes, Graphics,Controls, Forms, Dialogs, MyMethods;
Interface
Type
TForm1 = class(TForm)
Procedure Create(Sender: TObject);
Private
{}
Public
{}
End;
Var
Form1: TForm1;
Implementation
Procedure TForm1.Create(Sender: TObject);
Var
S: string;
Begin
HelloWorld;
s:=WhatDate;
showMessage(s);
showMessage(WhatDate);
|
|
End;
End.
:
Delphi :
1) USES
2) INTERFACE , , , .
a) TYPE , .
b) VAR
c) CONST
3) IMPLEMENTATION . END END.
, USES. .. , , . , INTERFACE IMPLEMENTATION. . INTERFACE , , BEGIN. BEGIN IMPLEMENTATION END END;:
Procedure MyProc;
Type
MyRec = record
Field: integer;
End;
Function GetANumber: integer;
Begin
Return:=Random(100)+1;
End;
Var
myVariant: integer;
rec: MyRec;
Const
myConst = 65;
Begin
myVariant:=GetANumber;
rec.field:=myVariant;
ifrec.field<>myConst
Then
showMessage(Yes, it is statistic!)
Else
showMessage(No! It is a miracle! Change was 1/100);
End;