home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
VRAC
/
FAST220C.ZIP
/
OBJECTS.CH
< prev
next >
Wrap
Text File
|
1993-08-28
|
3KB
|
83 lines
// Objects.ch ver 2.0 c
// (C) Antonio Linares, 1993
// Antonio Linares
// Avd. R. Soriano 68, 1-7
// 29600 Marbella - SPAIN
//----------------------------------------------------------------------------//
#ifndef _OBJECTS_CH
#define _OBJECTS_CH
#xcommand DEFAULT <uVar1> := <uVal1> ;
[, <uVarN> := <uValN> ] => ;
<uVar1> := If( <uVar1> == nil, <uVal1>, <uVar1> ) ;;
[ <uVarN> := If( <uVarN> == nil, <uValN>, <uVarN> ); ]
#xcommand CLASS <ClassName> ;
[ <from: INHERIT FROM, FROM, OF> <Parent1> [ ,<ParentN> ] ] ;
=> ;
function <ClassName>() ;;
static nClassHandle ;;
if nClassHandle == nil ;;
ClsNew( <"ClassName">, { [ <Parent1>():ClassH ] ;
[,<ParentN>():ClassH ] } ) ;;
#define _PARENT <Parent1>():ClassH
#xcommand DATA <Data1> [,<DataN>] => ;
ClsAddData( <"Data1">, 0 ) [; ClsAddData( <"DataN">, 0 ) ]
#xcommand VAR <Data1> [,<DataN>] => ;
ClsAddData( <"Data1">, 0 ) [; ClsAddData( <"DataN">, 0 ) ]
#xcommand METHOD <MethodName>( [<uParms,...>] ) CONSTRUCTOR => ;
ClsAddMethod( <"MethodName">, ;
{ | Self [, <uParms> ] | <MethodName>( Self [, <uParms> ] ), Self } )
#xcommand METHOD <MethodName>( [<uParms,...>] ) => ;
ClsAddMethod( <"MethodName">, ;
{ | Self [, <uParms> ] | <MethodName>( Self [, <uParms> ] ) } )
#xcommand METHOD <MethodName>( [<uParms,...>] ) VIRTUAL => ;
ClsAddMethod( <"MethodName">, { || nil } )
#xcommand METHOD <MethodName>( [<uParms,...>] ) SETGET => ;
ClsAddMethod( <"MethodName">,;
{ | Self [,<uParms>] | <MethodName>( Self [,<uParms>] ) } ) ;;
ClsAddMethod( "_" + <"MethodName">,;
{ | Self [,<uParms>] | <MethodName>( Self [,<uParms>] ) } )
#xcommand METHOD <MethodName>( [<uParms,...>] ) ;
<inline: BLOCK, INLINE> <bCodeBlock> => ;
ClsAddMethod( <"MethodName">, <bCodeBlock> )
#xcommand ENDCLASS => ;
nClassHandle = nClsMake() ;;
end ;;
return __ClassIns( nClassHandle )
#xtranslate :: => Self:
//------ METHODS Sintax -----------
// C++ style
#xtranslate METHOD <ClassName>::<MethodName>( [<uParms,...>] ) => ;
static function <MethodName>( Self [, <uParms>] ) // CLASS <ClassName>
// ASPEN style
#xtranslate METHOD <MethodName>( [<uParms,...>] ) CLASS <ClassName> => ;
static function <MethodName>( Self [, <uParms>] ) // CLASS <ClassName>
#xtranslate FUNCTION <ClassName>.<MethodName>( [<uParms,...>] ) => ;
static function <MethodName>( Self [, <uParms>] ) // CLASS <ClassName>
//---------------------------------
#xtranslate Super:<Method>( [<uParms,...>] ) => ;
Super( _PARENT, <"Method">, Self [,<uParms>] )
#endif
//----------------------------------------------------------------------------//