TRY oTest = CREATEOBJECT( "fdfApp.FdfApp" ) * do something with your object CATCH =MESSAGEBOX("No object",0+48,"Error" ) FINALLY * some cleanup code ENDTRYor
* save current error handler cOrgError = ON("ERROR") * create dummy error handler lError = .f. ON ERROR lError = .t. * create object oTest = CREATEOBJECT( "fdfApp.FdfApp" ) * restore original error handler ON ERROR &cOrgError * test for error condition IF lError =MESSAGEBOX("No object",0+48,"Error" ) ELSE * do something with your object ENDIF