Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FiveWin 1.9.2 - January 97 - Norton Guide http://www.X-Hacker.org [^^Up^^] [Menu] [About The Guide]
 OBJECTS engine                                                              .
--------------------------------------------------------------------------------

 OBJECTS Syntax
--------------------------------------------------------------------------------

  #include "Objects.ch"

  CLASS <TMyClass> [ FROM <TParentClass> ]

     [ EXPORT | PUBLIC ]             \
     [ PROTECTED | READONLY ]         |  Scope clauses
     [ LOCAL | HIDDEN ]              /

     DATA <DataName>  [ AS CHARACTER | NUMERIC | DATE | LOGICAL
                               CODEBLOCK | NIL ]
     ...

     METHOD <MethodName>( [ <params,...> ] ) ;
             [ CONSTRUCTOR | SETGET | VIRTUAL | BLOCK ]

     METHOD <MethodName>( [ <params,...> ] ) ;
             INLINE <uCode, ...>

     MESSAGE <cMsgName> METHOD <MethodName>

  ENDCLASS


  <TMyClass>      Is the name of the new Class we are going to create. It may
                  not exceed from ten characters.

  <TParentClass>  Is the name of the Class from which we want to inherit a
                  new Class.

  <DataName>      They are the name of the Data elements (instance variables)
                  we want to have for the Objects of this new Class.

 <MethodName>    Is the name of the Methods of the Objects.

 <params,...>    Is an optional list of elements to be passed as parameters
                  to the methods.

 Clauses
--------------------------------------------------------------------------------

 CONSTRUCTOR     When we are going to initialize an Object and we want to
                 automatically return a reference to self.
                 It is a good practice to first specify the methods
                 that allows you to build an object (constructors).

 SETGET          They are for calculated Data. This means we will manipulate
                 this name of a method like a Data.

 VIRTUAL         Methods that do nothing. Very useful for inheritances and
                 when you are starting creating and testing a Class.

 BLOCK           Extremely fast and easy to code, use this clause when you
                 want to declare 'inline' methods just from the definition
                 of the Class. We use a lot of them in FiveWin Classes. You
                 have to specify as first parameter 'Self'.

                 All methods automatically require a first parameter
                 which it is the 'Self'. Objects.ch automatically
                 provides 'Self' in standard METHODs, but in BLOCK
                 Methods you must specify it. So, BLOCK require to
                 specify 'Self' and the codeblock parameters:

                     METHOD <MethodName> BLOCK ;
                        { | Self, <arg1>, <arg2>, ..., <argN> | ... }

                 The advantadge of BLOCK methods over standard
                 METHODs is that they don't require to write the
                 related code, as it is included in the same declaration.
                 So it reduces the number of required Clipper symbols,
                 but it has the disadvantadge that always a codeblock
                 must be evaluated. On a standard METHOD a codeblock
                 evaluation is not necessary, so we avoid one execution
                 step.

 INLINE          The same functionality than the BLOCK clause, but it is
                 much more easy to use as it is not necessary to build the
                 codeblock -it is automatically built- It is better xBase!
                 We plan in next versions of FiveWin to convert all our
                 BLOCK methods into INLINE clauses.

                 INLINE Methods get automatically converted into BLOCK
                 methods definition. It is just an easier and faster way
                 to code a BLOCK method. We recommend you to use INLINE
                 methods instead of BLOCK methods.

                 As INLINE methods get automatically preprocessed into
                 BLOCK methods, the 'self' is automatically provided so
                 it is not needed to specify it.

 Methods codification
--------------------------------------------------------------------------------

 METHOD <MethodName>( [<params,...>] ) CLASS <TMyClass>

    -we have a local 'Self' ready to use here.

    -use ::<Data> for accessing Self:<Data>.

 return

 Include only ONE class per .PRG.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson