Statement INLINE Foundation

Declares an inline method

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

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.

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

CLASS MyClass 
   VAR varA, varB 

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

   METHOD display 

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

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.