Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complement to CreateBinary()
Message
From
15/07/1999 09:50:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/07/1999 11:25:05
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00241273
Message ID:
00241744
Views:
16
>Howdy All,
>Does anyone know of a way to turn an array into a string quickly? I have to pass both arrays of bytes and binary strings to COM servers and clients. CreateBinary() is great at the conversion from string to array but I have been having to manually convert arrays to strings,(cData = cData + aData[x]...) MUCH slower, esp. with a 50k array. Thanks in advance.
>
>Gary Foster
Gary,
String concat. is painfully slow in Fox. I try to mimic C way (but not in memory) for such things. I cannot use memory as a stream but a file :
lcTempFile = "X"+sys(2015)+".tmp"
lnHandle = fcreate(lcTempFile)
lnElems = alen(myArray,1)
for ix = 1 to lnElems
   =fwrite(lnHandle,myArray[ix,1])
endfor
lnSize = fseek(lnHandle,0,2)
= fseek(lnHandle,0,0)
lcStr=fread(lnHandle,lnSize)
=fclose(lnHandle)
erase (lcTempFile)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform