Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-07 Thread Pritpal Bedi
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

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-07 Thread Viktor Szakáts
> 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

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-07 Thread Xavi
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

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-07 Thread Przemysław Czerpak
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

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-07 Thread Przemysław Czerpak
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

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-07 Thread Viktor Szakáts
> #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

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-06 Thread Xavi
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

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-06 Thread Przemysław Czerpak
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 ) >

Re: [Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-06 Thread Viktor Szakáts
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

[Harbour] BEGIN/END SEQUENCE Fails or is intended as such ?

2009-12-06 Thread Pritpal Bedi
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

[Harbour] Begin/End Sequence

2009-03-14 Thread marek . horodyski
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'