Previous Next Table of Contents

3. CLASS METHOD implementation

Both Class(y) and Xbase++ support class methods, however, the implementation syntax differs. With Class(y), the implementation of a class method would look like:

Method myClassMethod()

   // ...

Return( ... )

however, Xbase++ insists that the implementation syntax is:

Class Method myClassMethod()

   // ...

Return( ... )

Notice that in Xbase++ you must say CLASS METHOD, just saying METHOD won't do. Class(y) on the other hand can't allow you do use CLASS METHOD because it would clash with the #command that defines the syntax for the CLASS METHOD declaration.

The only possible work around I can think of is to write your code as:

#ifdef __XPP__
Class Method myClassMethod()
#else
Method myClassMethod()
#endif

   // ...

Return( ... )

See Tools For Supporting Both Environments for a method of doing this without having to change all of your code by hand.


Previous Next Table of Contents