Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UDF transmutation
Message
De
12/08/2015 08:35:45
 
 
À
12/08/2015 06:43:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01623094
Message ID:
01623177
Vues:
55
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform