Forward Declaring Methods
Methods can be forward declared using the Register_Procedure and Register_Function statements respectively. Forward declaring allows you to reference one procedure or function in some other method before it is formally declared. The compiler would generate an error if you tried to do this without a forward declaration.
Forward Declaring Procedure Methods
The syntax for forward declaring a Procedure method is:
Register_Procedure {procedure-name} [{type1} {param1} {type2} {param2} …]
Forward Declaring Procedure Set Methods
The syntax for forward declaring a Procedure Set method is:
Register_Procedure Set {procedure-name} [{type1} {param1} {type2} {param2} …]
Forward Declaring Function Methods
The syntax for forward declaring a Function method is:
Register_Function {function-name} [{type1} {param1} {type2} {param2} …] ;
Returns {return-type}
In other words, the syntax for forward declaring a method is the same as the first line of a regular method declaration except that the commands Register_Procedure and Register_Function are used instead. The type, number, and order of parameters in the forward declaration must match the real procedure or function declaration.
Examples of Forward Declaring Methods
Register_Procedure DoWriteCharacters String sMessage
Register_Procedure Set Height Integer iX
Register_Procedure Set Width Integer iY
Register_Function Height Returns Integer
Register_Function Width Returns Integer
The above examples would allow you to reference the registered methods inside the body of some other method declaration even if its own formal declaration has not yet been made.