Hello Przemek
Przemysław Czerpak wrote:
>
> Please read in Clipper documentation what BEGIN SEQUENCE / RECOVER / END
> exactly does. RECOVER is activated only when error handler calls BREAK().
> I guess that you wanted to make sth like:
>
>/* Clipper compatible code */
>
>cbError := E
> To me is clear: global setting of BEGIN SEQUENCE limits the possibilities.
> I do not know if it has clarified the issue. Pritpal?
> P.e. In the *local* context of the function EvalAsString .-
>
> #xcommand BEGIN SEQUENCE => BEGIN SEQUENCE WITH { |oErr| Break( oErr ) }
I can't see any advantage
Gracias Przemek,
important things like setting NETERR() or setting 0 as result of
division by 0 stop to work.
To me is clear: global setting of BEGIN SEQUENCE limits the possibilities.
I do not know if it has clarified the issue. Pritpal?
P.e. In the *local* context of the function EvalAsStrin
On Mon, 07 Dec 2009, Xavi wrote:
Hi,
> Maybe you need to put this before .-
> #xcommand BEGIN SEQUENCE => BEGIN SEQUENCE WITH { |oErr| Break( oErr ) }
> or better yet .-
> #xcommand TRY => BEGIN SEQUENCE WITH t_bBreak
> #xcommand CATCH [] => RECOVER [USING ] <-oErr->
> #xcommand FINA
On Mon, 07 Dec 2009, Xavi wrote:
Hi,
> Maybe you need to put this before .-
> #xcommand BEGIN SEQUENCE => BEGIN SEQUENCE WITH { |oErr| Break( oErr ) }
I forgot to add that this is very bad idea because it fully disable
error handler just like TRY / CATCH in xHarbour. It means that some
important
> #xcommand BEGIN SEQUENCE => BEGIN SEQUENCE WITH { |oErr| Break( oErr ) }
>
> or better yet .-
>
> #xcommand TRY => BEGIN SEQUENCE WITH t_bBreak
> #xcommand CATCH [] => RECOVER [USING ] <-oErr->
> #xcommand FINALLY => ALWAYS
>
> THREAD STATIC t_bBreak := { |oErr| Break( oE
Pritpal,
Maybe you need to put this before .-
#xcommand BEGIN SEQUENCE => BEGIN SEQUENCE WITH { |oErr| Break( oErr ) }
or better yet .-
#xcommand TRY => BEGIN SEQUENCE WITH t_bBreak
#xcommand CATCH [] => RECOVER [USING ] <-oErr->
#xcommand FINALLY => ALWAYS
THREAD STATIC
On Sun, 06 Dec 2009, Pritpal Bedi wrote:
Hi,
> Look at this code:
> FUNCTION EvalAsString( cExp )
>LOCAL cValue
>cExp := "c:\"
>BEGIN SEQUENCE
> cValue := eval( &( "{|| " + cExp + "}" ) )
>RECOVER
> cValue := cExp
>END SEQUENCE
>IF !hb_isChar( cValue )
>
Hi Pritpal,
> FUNCTION EvalAsString( cExp )
> LOCAL cValue
>
> cExp := "c:\"
>
> BEGIN SEQUENCE
> cValue := eval( &( "{|| " + cExp + "}" ) )
> RECOVER
> cValue := cExp
> END SEQUENCE
>
> IF !hb_isChar( cValue )
> cValue := ""
> ENDIF
>
> RETURN cValue
>
>
> REC
Hi
Look at this code:
FUNCTION EvalAsString( cExp )
LOCAL cValue
cExp := "c:\"
BEGIN SEQUENCE
cValue := eval( &( "{|| " + cExp + "}" ) )
RECOVER
cValue := cExp
END SEQUENCE
IF !hb_isChar( cValue )
cValue := ""
ENDIF
RETURN cValue
RECOVER does not
Sorry for my previons post in html. I send it from www, and no't can change
format.
Sample code is :
FUNCTION Main()
LOCAL b, y, oErr
begin sequence
? 'Hello world'
InKey( 1)
b := { |n, x|
y := valtype( n)
SWITCH y
CASE 'N'
x := Str( n)
Break
CASE 'D'
11 matches
Mail list logo