Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə133/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   129   130   131   132   133   134   135   136   ...   294
DelphiLanguageGuide

Local Declarations
The body of a function or procedure often begins with declarations of local variables used in the routine's statement
block. These declarations can also include constants, types, and other routines. The scope of a local identifier is
limited to the routine where it is declared.
Nested Routines
Functions and procedures sometimes contain other functions and procedures within the local-declarations section
of their blocks. For example, the following declaration of a procedure called 
DoSomething
 contains a nested
procedure.
procedure DoSomething(S: string);
var
  X, Y: Integer;
            
procedure NestedProc(S: string);
begin
  ...
end;
 
begin
  ...
  NestedProc(S);
  ...
end;
The scope of a nested routine is limited to the procedure or function in which it is declared. In our example,
NestedProc
 can be called only within 
DoSomething
.
For real examples of nested routines, look at the DateTimeToString procedure, the ScanDate function, and other
routines in the 
SysUtils
 unit.
118


Parameters
This topic covers the following items:
Parameter semantics
String parameters
Array parameters
Default parameters

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   129   130   131   132   133   134   135   136   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin