__objAddInline()

Add an INLINE to an already existing class

Syntax

__objAddInline( <oObject>, <cInlineName>, <bInline> ) --> oObject

Arguments

<oObject> is the object to work on.

<cInlineName> is the symbol name of the new INLINE to add.

<bInline> is a code block to associate with the INLINE method.

Returns

__objAddInline() return a reference to <oObject>.

Description

__objAddInline() is a low level class support function that add a new INLINE method to an object. <oObject> is unchanged if a symbol with the name <cInlineName> already exist in <oObject>.
Examples
      // create a new THappy class and add a Smile INLINE method
      oHappy  := HBClass():New( "THappy" )
      bInline := { | nType | { ":)", ";)", "*SMILE*" }[ nType ] }
      __objAddInline( oHappy, "Smile", bInline )
      ? oHappy:Smile( 1 )       // :)
      ? oHappy:Smile( 2 )       // ;)
      ? oHappy:Smile( 3 )       // *SMILE*
Status

Ready

Compliance

__objAddInline() is a Harbour extension.

Files

Library is rtl

See Also