Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Side by side comparison (strings & local data)
Message
From
05/01/2004 04:40:53
 
 
To
27/12/2003 14:32:45
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00861648
Message ID:
00863786
Views:
19
Hi Dragan

The example you gave me took around 14 times as long.

Kev

>>Hi all
>>
>>Just did a quick side-by-side comparison with C# and VFP8, the test is aimed at string building from local-data using ADO.Net & Fox's local data-engine, can anyone tell me if I've messed up in away or if there is a quicker way of doing this:
>>
>>Here's the VFP program:
>
>Here's the VFP program the way I'd write it:
>
LOCAL lcBigXML
>Close Databases all
>*Start time
>SET DECIMALS TO 3
>
>USE C:\DEV\CSHARP\DEMO\DEMOS\DATA\CLIENT IN 0
>
>SELECT * FROM Client WHERE UPPER(Cl_Sname) = "LAWRENCE" INTO CURSOR TEST NOFILTER
>
>=AFIELDS(laFields, "Test")
>
>StartTime = SECONDS()
>Set Textmerge to memvar lcText noshow
>Set Textmerge delimiters to "{{","}}"
>Set Textmerge on
>\local lcXml
>\	lcXML ="<CLIENT>"
>	FOR f = 1 TO ALEN(laFields, 1)
>\		lcXML = lcXML + "<{{Alltrim(laFields(f, 1))}}>" + ;
>\			TRANSFORM(Test.{{Alltrim(laFields(f, 1))}}) +;
>\			"</{{Alltrim(laFields(f, 1))}}>"
>	ENDFOR
>\	lcXML = lcXML + "</CLIENT>"
>\return lcXml
>Set Textmerge to
>StrToFile(lcText, "runner.prg")
>Compile runner.prg
>lcBigXml="<TEST>"
>Scan
>	lcBigXml=lcBigXml+runner()
>ENDSCAN
>
>lcBigXML = lcBigXML + "</TEST>"
>
>*Show Time-Taken
>?SECONDS() - StartTime
>
>Now if you don't mind, compare this for speed.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform