__objModInline()

Template

Function

Name

__objModInline()

Category

API

Subcategory

Objects

Oneliner

Modify (replace) an INLINE method in an already existing class

Syntax

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

Arguments

<oObject> is the object to work on.

<cInlineName> is the symbol name of the INLINE method to modify.

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

Returns

__objModInline() return a reference to <oObject>.

Description

__objModInline() is a low level class support function that modify an INLINE method in an object and replace it with a new code block. <oObject> is unchanged if a symbol with the name <cInlineName> does not exist in <oObject>. __objModInline() is used in inheritance mechanism.

Examples

      // create a new THappy class and add a Smile INLINE method
      oHappy  := HBClass():New( "THappy" )
      bMyInline   := {| nType | { ":)",  ";)" }[ nType ] }
      bYourInline := {| nType | { "*SMILE*",  "*WINK*" }[ nType ] }
      __objAddInline( oHappy,  "Smile",  bMyInline )
      ? oHappy:Smile( 1 )       // :)
      ? oHappy:Smile( 2 )       // ;)
      // replace Smile inline method with a new code block
      __objModInline( oHappy,  "Smile",  bYourInline )
      ? oHappy:Smile( 1 )       // *SMILE*
      ? oHappy:Smile( 2 )       // *WINK*

Compliance

Harbour

Files

Library is core

Seealso

__objAddInline(), __objDelInline(), __objGetMethodList(), __objGetMsgList(), __objHasMethod()

4 responses to “__objModInline()

  1. Pingback: Harbour Internal Functions | Viva Clipper !

  2. Pingback: Harbour Internal Functions | Viva Clipper !

  3. Pingback: Harbour Objects Functions | Viva Clipper !

  4. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.