Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP and .NET Data Comparison
Message
 
À
16/01/2006 05:03:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
01080965
Message ID:
01087429
Vues:
50
This code sped it up by 60%. I forgot I could recompile from inside a VFP PRG.
EXECSCRIPT(lcCreateCursorScript)
* The EXECSCRIPT "replace" cmd line
lcUpdate=oXML.selectSingleNode("dbf2xml").selectSingleNode("update").text
lcCrLf=CHR(13)+CHR(10)
* Instead of an EXECSCRIPT for update - create a procedure file.
lcProcedure=[PROCEDURE DOM2DBF(oRow)]+lcCrLf;
           +[APPEND BLANK IN curReceived]+lcCrLf;
           +[WITH oRow]+lcCrLf;
           +lcUpdate+lcCrLf;
           +[ENDWITH]+lcCrLf;
           +[RETURN]
STRTOFILE(lcProcedure,[X2D.PRG])
COMPILE X2D
SET PROCEDURE TO X2D
* oRows has the records each in it's own <row> node
oRows=oXML.selectSingleNode("dbf2xml").selectSingleNode("rows")
nMaxRows=oRows.childNodes.length-1 && Assuming no empty cursor
SELECT curReceived
FOR C=0 TO nMaxRows
DOM2DBF(oRows.childNodes(C))
ENDFOR &&C=0 TO nMaxRows
Setting the "ResolveExternals" to false helped a bit too. This was a big file. The DBF I used (2399 records) was 1.6MB. The XML was 2.1MB (VFP parses a 2MB string (I used STRTRAN to replace the ampersands) in less than a second. It slows at curReceived. The speed could probably be halved again if the lcUpdate string was modifided and the data was "resolved" out of the XML and the XML script evaluations were pulled from the replace statement/
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform