Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP advantages over .NET
Message
De
22/08/2016 22:51:16
 
 
À
18/08/2016 16:52:54
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Divers
Thread ID:
01638709
Message ID:
01639780
Vues:
86
Format it nicely, just use the PRETEXT 15 parameter and all will be well.
text to lcSQL noshow textmerge pretext 15

select somefields
  from sometables
  where some stuff is true
  and have some subqueries

endtext
>>>>hmmm, only used textmerge to get pretty printed SQL or other strings, but never measured it against traditional assignment.
>>>>Even if it should employ only normal variable assignment, the style should help to eliminate memory thrashing via unneccessary temp variables/steps in between.
>>>>Do you have reason to believe it employs something else like memory mapped files?
>>>
>>>I think it uses a series of strextract(), eval() and stuff() calls. While the last function was there since forever (I think I even saw it in Clipper 87), the other two were, I think, first internally used in textmerge as early as Fox 2.0. Then the gods saw that these were good, and made them public.
>>>
>>>When I see some of my old code, from the nineties, where I used \ and \\ for output into a file... it worked, was blazingly fast, and the code was a mess. Once we got text-endtext into a variable, I never used those clumsy things again. And I think assignment with all chopped pieces being put together is equally messy.
>>
>>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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform