Statement INLINE Foundation

Declares an inline method

Syntax
INLINE [CLASS] METHOD <MethodName>[ (<xParam,...>) ]
Parameters
<MethodName>
<MethodName> is the identifier for the method to be declared.
<xParam>
<xParam> is an optional list of parameters which can be received by the INLINE METHOD.
Description

With INLINE, methods are declared which are already implemented within the class declaration CLASS...ENDCLASS. The program code must be written directly following the INLINE METHOD declaration. The last statement of the code should be RETURN. The compiler displays a warning if RETURN is not the last statement.

INLINE methods should not be comprised of more than 20 lines of code. It is generally recommended to always separate the method declaration from its implementation.

Examples
INLINE attribute for methods
// The example demonstrates both possible ways of 
// implementing methods 

CLASS MyClass 
   EXPORTED: 
   VAR varA, varB 

   INLINE METHOD init( cA, cB ) 
      ::varA := cA 
      ::varB := cB 
   RETURN self 

   METHOD display 
ENDCLASS 

METHOD MyClass:display 
  ? ::varA, ::varB 
RETURN self 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.