The code reads the XML, and is giving me a correct Xbrowse with the data
Writing it to dbf is a problem. Tried also with FW_arraytodbf
What do I miss here ??
Is there somewhere a post on multiply arrays explanations ? I have find some...
I get this error
Application
===========
Path and name: C:\Programmas\fotoselect\TEST.EXE (32 bits)
Size: 5,078,016 bytes
Compiler version: Harbour 3.2.0dev (r2008190002)
FiveWin version: FWH 20.08
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200
Time from start: 0 hours 2 mins 41 secs
Error occurred at: 14/12/2020, 10:28:42
Error description: Error DBFCDX/1020 Data type error: HEXCODE
Args:
[ 1] = U
Stack Calls
===========
Called from: .\TEST1.PRG => XMLREADER( 12166 )
Called from: .\TEST1.PRG => (b)BUILDMENU( 5745 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1556 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1141 )
Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND( 272 )
Called from: => TMDIFRAME:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3559 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1097 )
Called from: .\TEST1.PRG => MAIN( 71 )
System
======
- Code: Select all Expand view
function Xmlreader()
local aMail:={},nTel:= 1, i
local hFile := FOpen( "c:\programmas\fotoselect\kleuren.xml" )
Local oXmlDoc := TXmlDocument():New( hFile )
Local oXmlIter := TXmlIterator():New( oXmlDoc:oRoot ), oTagActual
//FW_XmlView( hFile )
nTel = 1
while .T.
oTagActual = oXmlIter:Next()
If oTagActual != nil
//if oTagActual:cName = "item"
// aadd(aMail,oTagActual:cData)
//endif
if oTagActual:cName = "colorHex"
cHex = oTagActual:cData
do while .t.
oTagActual = oXmlIter:Next()
If oTagActual != nil
if oTagActual:cName = "dutch"
cdd = oTagActual:cData //+ " : "+cHex
aadd(aMail ,{cdd,cHex} )
nTel++
exit
endif
endif
enddo
endif
Else
Exit
Endif
End
aStruct := {}
AADD(aStruct, { "kleuren", "C", 70, 0 }) // Id
AADD(aStruct, { "hexcode", "C", 10, 0 }) // Id
DbCreate( "shopcolor.dbf", aStruct)
use shopcolor NEW
xbrowser(aMail)
for i = 1 to len(aMail)
ckleur = amail[i,1]
cHex = aMail[i,2]
shopcolor->(dbappend())
shopcolor->kleuren = cKleur
shopcolor->hexcode = Chex
next
xbrowser("shopcolor")
FClose( hFile )
close all
return nil