INLINE (embed source code in a CLASS)

Top  Previous  Next

 

 

INLINE

 

 

 

CODE

 

 

<source code>

 

END

 

 

The INLINE Class keyword identifies any inline code that you wish to use. It is valid for standard methods, PROPERTYs, and INDEXERs. INLINE is required for all elements of a nested CLASS, but can also be used in standard CLASS structures.

 

For a standard method:

 

<method declaration>

INLINE

<body of the method>

END

 

For a property or indexer:

 

<property/indexer declaration>

INLINE

SETTER

CODE

<body of the setter>

 

GETTER

CODE

<body of the getter>

END

 

At least one SETTER or GETTER has to exist.

 

Clarion# support different access levels for INLINE syntax ONLY by specifying the access attribute directly after the SETTER/GETTER keyword:

 

setprop1  PROPERTY,SIGNED,PUBLIC,VIRTUAL

          INLINE

           GETTER

            CODE

            RETURN self.f

 

           SETTER, PROTECTED  ! Specify different access level

            CODE

             self.f = VALUE

          END

 

 

Example:

 

Start         CLASS

Lg             LONG

Sg             SIGNED

MyOtherClass   CLASS

MyMethod        PROCEDURE ! nested class must define methods INLINE

                INLINE

                 CODE

                  ! your code here

                END

              END   !MyOtherClass

inlineprop     PROPERTY, LONG

               INLINE

                GETTER

                 CODE

                 RETURN SELF.lg

                SETTER

                 CODE

                  SELF.lg=value

               END

              END

             END    !Start Class

 

 

See Also: PROPERTY, INDEXER