Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create a return error by ourself
Message
De
16/06/2002 09:07:39
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00669006
Message ID:
00669009
Vues:
12
Here is the technique that I have employed which works well for me.

  1. Create your own set of classes based upon whatever base you choose.
  2. replace the error method with code like this:
    lparameters nError, cMethod, nLine, toobj
    
    if vartype(toobj) <> 'O'
    	toobj = this
    endif
    
    if type('this.parent.name') = 'C'
    	if inlist(this.parent.baseclass+'|','Page|','Column|')
    		lcRetval = this.parent.parent.error(nError, cMethod, nLine, toobj)
    	else
    		lcRetval = this.parent.error(nError, cMethod, nLine, toobj)
    	endif
    else
    	if type('goapp.name') = 'C'
    		lcRetval = goApp.error(nError, cMethod, nLine, toobj)
    	else
    		lcRetval = 'X'
    	endif
    endif
    
    if vartype(lcRetval) = 'C' and not empty(lcRetval)
    	do case
    	case toobj = this and lcRetval = 'S'
    		set step on
    		return
    	case toobj = this and lcRetval = 'R'
    		retry
    	case toobj = this and inlist(lcRetval,'X','A')
    		cancel
    	otherwise
    		return lcRetval
    	endcase
    endif
  3. Create a global error handler for presenting and documenting the error.
  4. Add code to "Handle" errors which can be managed at this level and if not handled return DoDefault(nError, cMethod, nLine, toobj)


This is not a complete dissertation on error handling but a suggestion of an approach which works for me.

Glenn

>Hi guys...
>
>I want to know about how to create or make some error handling by ourself... accordingly to the huge error traping number in VFP but basely i want to make some error handling to networking error, file error and less more...
>
>thanks,
>i'll be thankfull if any of you help me..
>
>regards,
>tut_arie
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform