* tests/ainstest.prg
* tests/array16.prg
* tests/arrays.prg
* tests/atest.prg
* tests/clasinit.prg
* tests/classch.prg
* tests/classes.prg
* tests/dates.prg
* tests/db_brows.prg
* tests/ddate.prg
* tests/debugtst.prg
* tests/dynobj.prg
* tests/files.prg
* tests/gfx.prg
* tests/inline.prg
* tests/keywords.prg
* tests/objects.prg
* tests/onidle.prg
* tests/readhrb.prg
* tests/rtfclass.prg
* tests/speed.prg
* tests/switch.prg
* tests/test_all.prg
* tests/testbrw.prg
* tests/testcgi.prg
* tests/testcls.prg
* tests/testget.prg
* tests/testhtml.prg
* tests/testidle.prg
* tests/testinit.prg
* tests/testntx.prg
* tests/testpers.prg
* tests/testrdd2.prg
* tests/teststr.prg
* tests/tstblock.prg
* tests/tstmacro.prg
* tests/videotst.prg
* tests/vidtest.prg
* tests/wcecon.prg
* Cleanups. SVN header, '=' operator usage.
35 lines
667 B
Plaintext
35 lines
667 B
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
// Testing Harbour classes ON ERROR feature
|
|
|
|
#include "hbclass.ch"
|
|
|
|
function Main()
|
|
|
|
local o := Test()
|
|
|
|
o:Another( "Hello" ) // "Another" message is not defined for Class Test, but
|
|
// it will invoke ON ERROR MyErrorManager() method
|
|
|
|
o:Another := 5 // Notice how __GetMessage() shows a underscored message
|
|
// as we are setting a DATA value.
|
|
return nil
|
|
|
|
CLASS Test
|
|
|
|
ON ERROR MyErrorManager( uParam1 )
|
|
|
|
ENDCLASS
|
|
|
|
METHOD MyErrorManager( uParam1 ) CLASS Test
|
|
|
|
if PCount() > 0
|
|
Alert( uParam1 )
|
|
endif
|
|
|
|
Alert( __GetMessage() ) // Shows the message that was sent to the object
|
|
|
|
return nil
|