Hi Przemek
Przemyslaw Czerpak-2 wrote: > > On Tue, 10 Mar 2009, Kleyber wrote: > > Hi, > >> I have this line here: >> fwrite( n, @::oXml:ToString( HBXML_STYLE_INDENT+HBXML_STYLE_THREESPACES >> ) ) >> But it gives this error: >> nfe.prg(341) Error E0030 Syntax error "syntax error at ')'" >> Where is wrong? > > Your code. > You are trying to pass by reference sth what cannot be passed by > reference: result of method execution. Valid code should look like: > fwrite( n, ::oXml:ToString( HBXML_STYLE_INDENT+HBXML_STYLE_THREESPACES > ) ) > > xHarbour has bug and does not generate compile time error or even runtime > error for code like: > f( @o:msg( <params,...> ) ) > There are more similar situations in xHarbour, f.e.: > proc main() > local o, x > o:msg()-- > ++o:msg() > --o:msg(1,2,3) > o:msg(1,2,3)++ > x := ( @main( 1,2,3,4,5 ) ) > return > all of the above constructions should generate compile errors. > The 1-st to can be written as: > o:msg-- > ++o:msg > but the next three are technical nonsense so I cannot show you > alternative version. > Clipper also forbids compilation of code like: > o:msg()-- > ++o:msg() > Just try to compiler this code using Clipper. > > Grammar rules in xHarbour needs serious cleanups. > In some places like above illegal constructions are accepted > without any errors and some PCODE is generated (sometimes > is reduced by compiler to different but valid code, sometimes > unnecessery, dummy or wrong instructions are put into the PCODE. > In some other placeses xHarbour does not accept some valid syntax: > x := @main() > cannot be compiled and it's necessary to add dummy braces: > x := ( @main() ) > In some other compiler GPFs when you try to compile officially supported > code, f.e.: > o:&s++ > If some xHarbour developers read it then maybe they report it to xHarbour > devel list. > > best regards, > Przemek > _______________________________________________ > Once again, thank you very much. It's really true that xHarbour has some problems with it and in my migration to Harbour+MSVC+FWH I have to discover all of this. Best Regards, Kleyber Derick -- View this message in context: http://www.nabble.com/Error-in-FWRITE%28%29-function-tp22433625p22435210.html Sent from the Harbour - Dev mailing list archive at Nabble.com. _______________________________________________ Harbour mailing list [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour
