# Methods declaration

`[ STATIC ] ( PUBLIC | PRIVATE ) ( PROCEDURE | SUB | FUNCTION ) Identifier ( [ [ OPTIONAL ] Parameter #1 [ , [ OPTIONAL ] Parameter #2 ... ] ) [ AS Datatype ]
...
END`

This declares a class method. The `END` keyword indicates the end of the method.

- This method is accessible everywhere in the class it is declared.
- If the `PUBLIC` keyword is specified, it is also accessible to the other classes having a reference to an object of this class.
- If the `STATIC` keyword is specified, the method can only access to the static variables of the class.
- If the `FUNCTION` keyword is specified, the method is a function and the return datatype must be specified.
- If the `OPTIONAL` keyword is specified, the corresponding parameter is optional. Then you can specify a default value after the parameter declaration by using the equal sign.

Example

    STATIC PUBLIC PROCEDURE Main()
    ...
    PUBLIC FUNCTION Calc(A AS Float, B AS Float) AS Float
    ...
    PRIVATE SUB DoIt(Command AS String, OPTIONAL SaveIt AS BOOLEAN = TRUE)
    ...