Hi All,
A spanish expression says: "ser más papistas que el Papa" in English "be more
Catholic than the Pope".
I'm surprised that we are pass some lines and nobody says anything. Maybe not
understand the changes or are the holidays but...
Are we correcting errors in Clipper language? If so to me is OK but I'd like to
read more comments.
What is the result in the last xHarbour?
I have tested tst.prg with last Harbour and Clipper 5.2 also written another
test.prg case is more clear.
Output of test.prg .-
OO* arr[1]
Output HARBOUR
-----------------
REF arr[1]
REF o:cargo
-----------------
REF arr[1]
REF o:cargo
-----------------
Press any key to continue...
OO* arr[1]
Output Clipper
-----------------
OO* arr[1]
NIL o:cargo
-----------------
Press any key to continue...
---------------------------------------------------------------------------------------------
/*** Test.prg ***/
Procedure main()
PRIVATE arr[10], r, o
arr[1] := "OO"
r = 'arr[1]'
&r += '*'
? arr[1], r
#ifdef __HARBOUR__
? 'Output HARBOUR'
? '-----------------'
p( @arr[1] ) // Clipper Error C2009 Invalid use of @ (pass by reference)
operator
? arr[1], r
r = 'o:cargo'
o := ErrorNew()
p( @o:cargo ) // Clipper Error C2009 Invalid use of @ (pass by reference)
operator
? o:cargo, r
#else
? 'Output Clipper'
#endif
? '-----------------'
r = 'arr[1]'
p( @&r )
? arr[1], r
r = 'o:cargo'
o := ErrorNew()
p( @&r )
? o:cargo, r
? '-----------------'
Wait
return
proc p(x)
x:="REF"
return
/*** end of: Test.prg ***/
--
Xavi
Przemyslaw Czerpak escribió:
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
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour