Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a C++ Structure from a SELECT result
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00341095
Message ID:
00341322
Views:
26
Jim,

This test code:
create cursor x1 ( c01 c(30),c02 c(30),c03 c(30),c04 c(30),c05 c(30),c06 c(30),c07 c(30),c08 c(30),c09 c(30),c10 c(30),;
                   c11 c(30),c12 c(30),c13 c(30),c14 c(30),c15 c(30),c16 c(30),c17 c(30),c18 c(30),c19 c(30),c20 c(30),;
                   c21 c(30),c22 c(30),c23 c(30),c24 c(30),c25 c(30),c26 c(30),c27 c(30),c28 c(30),c29 c(30),c30 c(30) )

for i = 1 to 50
   append blank
endfor

t = seconds()

select * from x1 into array lajunk

lcString = ""
for i = 1 to _tally
   lcRow = ""
   for j = 1 to 30
      lcRow = lcRow + laJunk[i,j]
   endfor
   lcString = lcString + lcRow
endfor

? seconds() - t
Executes in 0.021 seconds on a lowly PII-350 box. That's not fast enough?

>Hi all, I am trying to return fairly large amounts of data from a SELECT to a C++ program (50 rows each containing 900 bytes of data spread across 30 columns). Even though MS claims to have "dramatically improved" the speed of string concatenation in vfp60, I find it very slow when I have to use it to build a single string from an array containing 1500 elements. This prevents me from being able to use "SELECT ... INTO ARRAY". The fastest way I have found so far is to use "SELECT ... TO FILE" and then use low-level file utilities to read in the results as a single long string. But that means disk I/O! Can anyone suggest something faster?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform