Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting field presence in dbf
Message
From
27/07/2007 13:56:39
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
27/07/2007 13:48:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01244177
Message ID:
01244198
Views:
24
>>Using a UDF can be slow
>
>Hello Mike,
>
>Can you elaborate on this?

The linked article goes into that, but basically there is overhead involved in calling a udf (same goes for stored procedures <g>). The effect is lessened once compiled into an exe, but it's always there.
create cursor somealias (somefield c(10))
a=seconds()
for x = 1 to 1000
  y=field("somefield","somealias")
endfor x
?seconds()-m.a

a=seconds()
for x = 1 to 1000
  y=myudf("somefield","somealias")
endfor x
?seconds()-m.a

function myudf
lparameters m.tcField, m.tcAlias
return field(m.tcField,m.tcAlias)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform