Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field as a Variable
Message
 
À
28/02/2002 11:27:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00626468
Message ID:
00626569
Vues:
14
>What I am trying to do is avoid a 52 week case statement by saving the field i.e. dmd_ as a variable junk_key and store a 1 to count_key. Then I would increment the count_key as needed. Thus, replacing an on_hand field with the field junk_key+alltrim(str(count_key) as needed. This would greatly decrease my coding. When I try the replace I get data type mismatch. Both field are integer. What I am asking is can I save a field as a variable nad use it in a replace statement for another field.

Chris,

If I understand correctly, this should be what you want:
count_key = 1
junk_key = "dmd_" + TRANSFORM(count_key)
REPLACE ALL ON_HAND WITH EVALUATE(junk_key)
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform