Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Identify variables
Message
 
À
04/06/2007 23:23:31
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01230420
Message ID:
01230496
Vues:
21
>>I have an unknown set of variables that will be in scope in a function and will have a common prefix. How can I identify all of the variables and get their values (actually, all I need are the values)? I played around with using “save to” function but I feel like I’m missing something obvious.
>>
>>The vars will all have “chk_” as the prefix: chk_DCW, chk_SIR
>>
>>Thanks,
>
>I have a very strong impression that the whole issue could - and should - be circumvented by some design change. While I don't know exactly what you need those many variables for, some options might include:
>
  • Have an array. Each element can replace a variable.
    >
  • Have a string in memory. Each line might replace a variable, or you might use another convenient separator, such as a semicolon.
    >
    >Probably there are other ways, too, such as as XML, with which I have no experience. But perhaps you should tell a little more, where do those variables come from, what do you do with them, etc.

    Hilmar,

    I believe I have come to the same conclusion. I did not write the base code that provides the info so I was looking for an "easy" solution that would not require me to dig deep into the code.

    Thanks,
    Mike
    Michael McLain
  • Précédent
    Répondre
    Fil
    Voir

    Click here to load this message in the networking platform