User Tools

Site Tools


inline_embed_source_code_in_a_class_.htm
Navigation:  Clarion.Net (Clarion#) > Clarion# Language Extensions > CLASS Keyword >====== INLINE (embed source code in a CLASS) ====== Previous pageReturn to chapter overviewNext page
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

NoteBox.jpg

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

inline_embed_source_code_in_a_class_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1