*** empty log message ***

This commit is contained in:
Antonio Linares
1999-12-15 12:45:32 +00:00
parent 23f7719b73
commit c0f8b1e1ff
3 changed files with 27 additions and 4 deletions

View File

@@ -1,3 +1,10 @@
19991215-12:32 GMT+1 Antonio Linares <alinares@fivetech.com>
* source/rtl/classes.c
+ Added a new function __GetMessage() to retrieve the message
name from a Class error handler.
* tests/testcls.prg
* enhanced showing the use of __GetMessge()
19991215-12:09 GMT+1 Antonio Linares <alinares@fivetech.com>
+ added common.b32 provided by Jose Lalin
* tests/bld_b32.bat

View File

@@ -1245,4 +1245,14 @@ static HARBOUR hb___msgVirtual( void )
{
/* hb_ret(); */ /* NOTE: It's safe to comment this out */
;
}
/* to be used from Classes ERROR HANDLER method */
HARBOUR HB___GETMESSAGE()
{
PHB_ITEM pBase = hb_stack.pBase;
pBase = hb_stack.pItems + pBase->item.asSymbol.stackbase;
hb_retc( pBase->item.asSymbol.value->szName );
}

View File

@@ -6,19 +6,25 @@ function Main()
local o := Test()
o:Any() // Any message is not defined for Class Test, but
o:Any( "Hello" ) // Any message is not defined for Class Test, but
// it will invoke ON ERROR Any() method
o:Any = 5 // Notice how __GetMessage() shows a underscored message
// as we are setting a DATA value.
return nil
CLASS Test
ON ERROR Any( cMsg )
ON ERROR Any( uParam1 )
ENDCLASS
METHOD Any( cMsg ) CLASS Test
METHOD Any( uParam1 ) CLASS Test
Alert( "Inside Any" )
if PCount() > 0
Alert( uParam1 )
endif
Alert( __GetMessage() ) // Shows the message that was sent to the object
return nil