Syntax:
METHOD <access specifier> <method name> : <type of return value>
|
<access specifier> |
Optional Access specifier Depending on the declared access specifier, a method can be called only within its
own namespace ( |
|
<method name> |
Identifiers of methods |
|
<type of retur value> |
Optional Return type of the method Note: In the case of methods which do not have an explicit return type, the first declared output is used as the return value. A method does not return a value only if neither the return type nor the output are declared. However, a compiler error is not generated in either case. |
|
<scope list> |
Scopes:
|
|
<variable declaration list> |
Variable declaration <variable name> : <data type> := <initial value> ; Semicolon-delimited list of variables (parameters) assigned to a scope according to their purpose.
|
Example
Declaration
METHOD PUBLIC DoIt : BOOL
VAR_INPUT
iInput_1 : DWORD;
iInput_2 : DWORD;
sInput_3 : STRING(12);
END_VAR