Re: [Harbour] Error BASE/1099 Argument error: STR
Hi Viktor, I don't understand how to implement follow line Rather use -i option or point to xhb.hbc file. (or simply copy your sample to contrib/xhb/tests/ dir and issue hbmk2 from there) I also tried all the suggestions figure out but unfortunatly it doesn't work: The mistake is: Compiling 'xml1.prg'... xml1.prg(17) Warning W0001 Ambiguous reference 'TXMLDOCUMENT' No code generated. hbmk2: Error: Running Harbour compiler (embedded). 1 (/usr/bin/harbour) -n2 xml1.prg -w3 -es2 -o/tmp/ -i/usr/include/harbour -i.. -i../../hbct -i../../hbtip -i/usr/local/lib/harbour Thanks in advance Ivan ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
[Harbour] Error BASE/1099 Argument error: STR
$ hbmk2 xml1.prg -lxhb -L/usr/local/lib/harbour hbmk2: Processing configuration: /usr/bin/hbmk.cfg Harbour 2.1.0beta1 (Rev. 14394) Copyright (c) 1999-2010, http://www.harbour-project.org/ Compiling 'xml1.prg'... Lines 168, Functions/Procedures 1 Generating C source output to '/tmp/xml1.c'... Done. $ ./xml1 Error BASE/1099 Argument error: STR Called from STR(0) Called from MAIN(19) Can someone help me? TIA Ivan ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Error BASE/1099 Argument error: STR
// xml1.prg #include /home/ivan/src/harbour/contrib/xhb/hbxml.ch function main() local cFile:=./test.xml, cString local cNote, cDiscount local oDoc, oBook, oIterator, oCurrent cString:=memoread( cFile ) if !( len(cString) 0 ) wait xml file unavailable return NIL endif oDoc:=TXmlDocument( cString, HBXML_STYLE_NOESCAPE ) if !( oDoc:nError==HBXML_ERROR_NONE ) wait xml file parsing error + str(oDoc:nError) return NIL endif oBook:=oDoc:findfirst( book ) if oBook == NIL wait no books found return NIL endif do while .t. if HHasKey( oBook:aAttributes, id ) ? book ID : + oBook:aAttributes[id] else ? no attribute book ID endif cNote:= cDiscount:= oIterator:=TXmlIterator():New( oBook ) do while .t. oCurrent:=oIterator:Next() if oCurrent==NIL ? end branch wait values : +cNote+ +cDiscount exit else ? current tag : + oCurrent:cName if oCurrent:cName==note cNote:=oCurrent:cData elseif oCurrent:cName==discount cDiscount:=oCurrent:cData endif endif enddo oBook:=oDoc:findnext() if oBook == NIL wait no more books found exit endif enddo return NIL catalog book id=bk101 authorGambardella, Matthew/author titleXML Developer's Guide note111/note /title genreComputer/genre price44.95 discount11/discount /price publish_date2000-10-01/publish_date descriptionAn in-depth look at creating applications with XML./description /book book id=bk102 authorRalls, Kim/author titleMidnight Rain note222/note /title genreFantasy/genre price5.95 discount12/discount /price publish_date2000-12-16/publish_date descriptionA former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world./description /book book id=bk103 authorCorets, Eva/author titleMaeve Ascendant note333/note /title genreFantasy/genre price5.95 discount13/discount /price publish_date2000-11-17/publish_date descriptionAfter the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society./description /book book id=bk104 authorCorets, Eva/author titleOberon's Legacy note444/note /title genreFantasy/genre price5.95 discount14/discount /price publish_date2001-03-10/publish_date descriptionIn post-apocalypse England, the mysterious agent known only as Oberon helps to create a new life for the inhabitants of London. Sequel to Maeve Ascendant./description /book book id=bk105 authorCorets, Eva/author titleThe Sundered Grail note555/note /title genreFantasy/genre price5.95 discount15/discount /price publish_date2001-09-10/publish_date descriptionThe two daughters of Maeve, half-sisters, battle one another for control of England. Sequel to Oberon's Legacy./description /book /catalog On Wed, Apr 28, 2010 at 5:37 PM, Antonio Maniero mani...@klip.net wrote: Please, post line 19 from your Main. []'s Maniero 2010/4/28 ivan re re.i...@gmail.com $ hbmk2 xml1.prg -lxhb -L/usr/local/lib/harbour hbmk2: Processing configuration: /usr/bin/hbmk.cfg Harbour 2.1.0beta1 (Rev. 14394) Copyright (c) 1999-2010, http://www.harbour-project.org/ Compiling 'xml1.prg'... Lines 168, Functions/Procedures 1 Generating C source output to '/tmp/xml1.c'... Done. $ ./xml1 Error BASE/1099 Argument error: STR Called from STR(0) Called from MAIN(19) Can someone help me? TIA Ivan ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Error BASE/1099 Argument error: STR
Hi, // xml1.prg #include /home/ivan/src/harbour/contrib/xhb/hbxml.ch Rather use -i option or point to xhb.hbc file. (or simply copy your sample to contrib/xhb/tests/ dir and issue hbmk2 from there) function main() local cFile:=./test.xml, cString local cNote, cDiscount local oDoc, oBook, oIterator, oCurrent cString:=memoread( cFile ) if !( len(cString) 0 ) wait xml file unavailable return NIL endif oDoc:=TXmlDocument( cString, HBXML_STYLE_NOESCAPE ) You need to replace 'TXmlDocument(' with 'TXmlDocument:New(' Viktor ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Error BASE/1099 Argument error: STR
Victor, If TXmlDocument( cString, HBXML_STYLE_NOESCAPE ) is a valid call, yet does not produce a correct object (given that I probably haven't seen the code), then can't TXmlDocument(...) check that :New is in the calling tree and produce a decent error? (Sorry if I'm stating or overlooked the obvious) Paul - Original Message - From: Viktor Szakáts harbour...@syenar.hu To: Harbour Project Main Developer List. harbour@harbour-project.org Sent: Wednesday, April 28, 2010 1:58 PM Subject: Re: [Harbour] Error BASE/1099 Argument error: STR Hi, // xml1.prg #include /home/ivan/src/harbour/contrib/xhb/hbxml.ch Rather use -i option or point to xhb.hbc file. (or simply copy your sample to contrib/xhb/tests/ dir and issue hbmk2 from there) function main() local cFile:=./test.xml, cString local cNote, cDiscount local oDoc, oBook, oIterator, oCurrent cString:=memoread( cFile ) if !( len(cString) 0 ) wait xml file unavailable return NIL endif oDoc:=TXmlDocument( cString, HBXML_STYLE_NOESCAPE ) You need to replace 'TXmlDocument(' with 'TXmlDocument:New(' Viktor ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Error BASE/1099 Argument error: STR
Hi Paul, If TXmlDocument( cString, HBXML_STYLE_NOESCAPE ) is a valid call, yet does not produce a correct object (given that I probably haven't seen the code), then can't TXmlDocument(...) check that :New is in the calling tree and produce a decent error? (Sorry if I'm stating or overlooked the obvious) Yes, it would be useful error to cover this case. This is a common problem when porting code from xhb to Harbour. I don't know how to implement it though. Anyone? Viktor ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Error BASE/1099 Argument error: STR
// xml1.prg #include /home/ivan/src/harbour/contrib/xhb/hbxml.ch Rather use -i option or point to xhb.hbc file. (or simply copy your sample to contrib/xhb/tests/ dir and issue hbmk2 from there) function main() local cFile:=./test.xml, cString local cNote, cDiscount local oDoc, oBook, oIterator, oCurrent cString:=memoread( cFile ) if !( len(cString) 0 ) wait xml file unavailable return NIL endif oDoc:=TXmlDocument( cString, HBXML_STYLE_NOESCAPE ) You need to replace 'TXmlDocument(' with 'TXmlDocument:New(' Typo. Replace it with: 'TXmlDocument():New(' Anyhow not everything is fine with xhb xml support, as I'm getting memory corruption with the posted sample when trying it with mingw. It runs fine with msvc64. Viktor ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Error BASE/1099 Argument error: STR
Viktor Szakáts wrote: Anyhow not everything is fine with xhb xml support, as I'm getting memory corruption with the posted sample when trying it with mingw. It runs fine with msvc64. I have noticed quite a few fixes over recent years/months to the XML source in xHarbour, it's possible that Harbour has missed something important. Regards Alex ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour
Re: [Harbour] Error BASE/1099 Argument error: STR
Anyhow not everything is fine with xhb xml support, as I'm getting memory corruption with the posted sample when trying it with mingw. It runs fine with msvc64. I have noticed quite a few fixes over recent years/months to the XML source in xHarbour, it's possible that Harbour has missed something important. Could be. I'm not very convinced about the whole quality of this xml implementation. The xhb patches didn't convey any good impressions either. Many of them were debated and fixed back and forth, so I lost track of it. It's also possible I broke something in this commit, while trying to apply recent xhb memory-leak patches: 2010-04-05 11:04 UTC+0200 Viktor ___ Harbour mailing list (attachment size limit: 40KB) Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour