Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UDF transmutation
Message
From
12/08/2015 08:35:45
 
 
To
12/08/2015 06:43:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01623094
Message ID:
01623177
Views:
54
Was in "don't think, do" mental state. In that case

>>BTW
>>
return eval ( 
                       iif (SEEK( tcValue, tcAlias, tcTag )  ;
                          , tcReturnField;
                          , "CAST('  ' as " + type(tcReturnField) +")" ;
                       )
is much shorter and as a one-liner most of the time creates faster running p-code.
The else-branch is now also evaluated, but base expression does not need the icase checking branches depending on parameter type.

As this is now a one-liner, a program could be written to expand the previous udf call in all source files.
@Mike: guessing at the wrapper call frequency and possible optimizations: if your main trouble lies in SQL calling the UDF millions of times, how about thinking to create a &Makroexpression? During loop execution they are a big no-no, but if used in SQL they are Makro-executed only once and the generated source expression is used without penalty for all records, eliminating the wrpper udf call.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform