Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simplify concantenated line of code
Message
De
17/07/2007 12:29:15
 
 
À
17/07/2007 12:26:21
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01241143
Message ID:
01241159
Vues:
34
>>>How to simplify this to remove the EVALUATE() and make it more readable?
>>>
>>>
>>>FOR ix = 1 to Whatever
>>>     REPLACE JMJ_IN.Diag1 WITH LEFT(ALLTRIM(UPPER(EVALUATE('loObj'+LTRIM(STR(m.ix))+".Field019"))),AT('^',EVALUATE('loObj'+LTRIM(STR(m.ix))+".Field019"))-1)
>>>ENDFOR
>>>
>>
>>
>>FOR ix = 1 to Whatever
>>    WITH EVALUATE('loObj'+TRANSFORM(m.ix))
>>         REPLACE JMJ_IN.Diag1 WITH LEFT(ALLTRIM(UPPER(.Field019)),AT('^',.Field019)-1)
>>    ENDWITH
>>ENDFOR
>>
>
>I forget that I can use WITH in PRG code! Thanks!

Oh, is this a v9 thing?
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform