Git Product home page Git Product logo

Comments (4)

druzus avatar druzus commented on August 24, 2024

ask on harbour-user list how to use object constructors/destructors in Harbour

from core.

 avatar commented on August 24, 2024

I know about how use !
I think that you not read about my sugestion.

from core.

mlacecilia avatar mlacecilia commented on August 24, 2024

Hi Lailton,
I think that Przemek read your post and that he answered to your question.
The method you want are already present in Harbour class management. See
in include/hbclass.ch:

/* special method(s) */
#xcommand CONSTRUCTOR => METHOD CONSTRUCTOR
#xcommand DESTRUCTOR => ;
_HB_MEMBER __HB_CLS_ASFUNC();;
__HB_CLS_DECLARE_METHOD __HB_CLS_PARAMS() CLASS_NAME ;;
oClass:SetDestructor( @__HB_CLS_ASID( __HB_CLS_MTHNAME CLASS_NAME
)() )
#xcommand DESTRUCTOR FUNCTION => ;
oClass:SetDestructor( @__HB_CLS_ASID( )() )

So you can easily code your methods using this syntax.
Anyway, please, post your questions on the user group, instead to
suggest already present implementations.
BR
Maurizio

Il 22/02/2014 01:18, Lailton Fernando Mariano ha scritto:

I know about how use !
I think that you not read about my sugestion.


Reply to this email directly or view it on GitHub
#49 (comment).

from core.

 avatar commented on August 24, 2024

Maurizio,

The my sugestion is:

class hb_test
method __construct() inline qout('contruct')
method __destruct() inline qout('destruct')
endclass

so.
class:=hb_test()
// automatic will call __contruct method.

class:=nil // automatic call __destruct
without need call a method initialize, and send the params too.
class:=hb_test('a',1,.t.) // send params to __contruct method.

It's only a sugestion :)

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.