Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP advantages over .NET
Message
De
19/08/2016 04:50:31
 
 
À
18/08/2016 16:52:54
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Divers
Thread ID:
01638709
Message ID:
01639674
Vues:
92
>>>>hmmm, only used textmerge to get pretty printed SQL or other strings, but never measured it against traditional assignment.
....

>>for me the only antipattern is more than a handful of lines always adding to and reassigning the same result variable, especially if done in consecutive lines.
>>Not relying on language specific things like \,\\ and textmerge for trivial code makes porting the code to another dialect or even language much easier and I encountered that often enough. So I decide on the probability that this code will be ported or used as a template for porting wether to use textmerge or single assignments spanning a dozen or more lines of string concatenation.
>
>ISTR getting burned once by TEXTMERGE - I was maintaining some existing code and had to wrap one in other code. For readability I indented the TEXTMERGE which caused it to fail, I think because tabs were introduced. Any code which fails when indented by tabs is too fragile for me so I've never used it since. I think in that case I moved the TEXTMERGE to a separate routine/method with no wrapping/indentation and commented it to leave it that way.
>
>I find when I'm building strings I like to be able to see the individual components, mainly for debugging. Doing that conventionally with assignments works well for me. How easy is it to see the contents of a TEXTMERGE in the debugger?

see first line ;-)
with me and sql statements the usual way is to run a primitive SQL beautifier (insert chr(13) before from, join, where, group by, having, order) and pipe into a file ***as part of the code if debug flag is on***, not the debug expirience: just a function call to SqlToFile(cSQL, cFile)
Easy to open out of process in a text window of TotalCommander ;-))

File building code follows pattern of
local laParts[100]  && typically multiples of 10
laParts = "" && ALL lines!
laParts[1] = subst()......
....
laParts[87] = subst()......
lcResult = goArrayTools.ArrayToStr(laParts)  && optimized to get result without temp storage pattern
which can be easily transformed for often called/critical code via keyboard macro
* local laParts[100]  && typically multiples of 10
* laParts = "" && ALL lines!
lcResult =  subst()......   ;
....
+  subst()......
* lcResult = goArrayTools.ArrayToStr(laParts)  && optimized to get result without temp storage pattern
which is used depending on the input format definitions of the external process, sometimes recursive if something like blocks of lines with "pageseparators" are defined externally.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform