www.kxcad.net Home > Electronic Index > Altium(Protel) Index
In a Delphi script file, the functions and procedures are declared using the Procedure Begin End or Function Begin End block or Var Begin End block. Both of these statement blocks require a name to be given to the procedure or function. Delphi Script allows you to create named variables and constants to hold values used in the current script.
Functions, Procedures example
Function A : Integer;
Begin
Result := 10;
End;
Procedure A;
Begin
ShowMessage(IntToStr(10));
End;
Var
A, B, C;
Begin
B := 10;
C := 20;
A := B + C;
ShowMessage(IntToStr(A));
End.
In general, there is no restriction to the names you can give to procedures, functions, variables and constants as long as they adhere to the following rules:
• The name can contain the letters A to Z, a to z, the underscore character "_" and the digits 0 to 9.
• The name must begin with a letter.
• The name cannot be a Delphi Script keyword, directives or reserved word.
• Names are case insensitive when interpreted. You may use both upper and lower case when naming a function, subroutine, variable or constant, however the interpreter will not distinguish between upper and lower case characters. Names which are identical in all but case will be treated as the same name in Delphi Script.
See also