Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why define constants
Message
De
25/10/2006 11:09:46
 
 
À
25/10/2006 10:45:42
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01164235
Message ID:
01164401
Vues:
8
>>>Not that I like that too much - I was doing that in 2.6 for just two languages, and you simply can't keep something like that in code, you have to have a table with one column per language, and some code to generate .h files from it. Otherwise it becomes quite impossible to find your way around in an editor, once the number of strings surpasses a few screenfuls.
>>
>>As you observe, it is a nice theoretical solution but far less so in practise.
>>And I wonder how easy it is to find an error in the (now hidden from view) "logic" within the 'code'?
>
>And you can do quite weird things... I once had a really messy piece of special manually done report, where I had a lot of fwrite(h,SomeLengthyPrefixExpression+lcText) repeated all over the place. So I did this:
>
#define push fwrite(h,SomeLengthyPrefixExpression+
>
>push "text 1")
>push "text 2")
>
>It reduced the total length of the code by nearly a third, worked great and confused me completely next time I looked at the code.

A UDF would have worked also:
FUNCTION push( tcTxt )
   fwrite(h,SomeLengthyPrefixExpression+m.tcTxt)
   RETURN
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform