On Thu, 02 Jul 2009, Przemyslaw Czerpak wrote:

Hi,

> > Maybe, this issue was discussed already, but ...
> > This code gives an error with Harbour, but works with Clipper:
> > PROCEDURE main
> > PRIVATE arr[10], r
> >    arr[1] := "OO"
> >    r = 'arr[1]'
> >    &r += '*'    // Runtime "Syntax error: &" with Harbour
> >    ? arr[1], r
> > Return Nil
> > Is this error or a feature :) ?
> Bug. In Harbour when some optimizations are enabled
> only pure symbols can be used as macro value in left side
> of <op>= or as argument of ++ and -- operators.
> With -kc Clipper compatible code is generated so thew above
> example will work.
> I'll analyze deeper the problem and I'll fix it to make Harbour
> fully Clipper compatible. Probably in next week.

It should be fixed now also with other unsupported so far combinations.
Please test after:
   2009-07-08 20:33 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

Below I'm attaching test code.
Just compare current Harbour, xHarbour and Clipper results.

best regards,
Przemek

/***** tst.prg *****/
proc main()
   test( "var", "init" )
   test( "var[1]", {"init"} )
   test( "var:cargo", errorNew() )
   ? "**********"; ?
return

#command DOTEST <exp> => ;
         begin sequence; <exp>; recover using e; dsp_err(e); end

proc test( s, v )
   local bErr, e
   bErr := errorBlock( {|e| break( e ) } )
   ? "=========="
   m->var:=v
   ? &s
   DOTEST p( @&s)
   ? &s
   DOTEST &s := "set"
   ? &s
   DOTEST &s += ":add"
   ? &s
   errorBlock( bErr )
return

proc p(x)
   x:="REF"
return

proc dsp_err(e)
   ? "error:", ;
     iif( e:severity == 2, "E", "" ), ;
     e:subsystem+"/"+ltrim(str(e:subCode)),;
     e:description + ":", e:operation
return
/***** end of: tst.prg *****/
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to