Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Equivalent to eval()
Message
 
 
À
28/03/2010 20:02:25
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01457734
Message ID:
01457735
Vues:
54
>I have a number of properties which are objects ( business objects )
>
>If I have string which is the same as the name of one of those properties I would like to find the value of a property of the corresponding object.
>
>in VFP
>
>*property is called _Propmaster
>
>varstr = "Propmaster"
>prop = "_"+varstr+".count"
>
>mycount = eval(prop)
>
>
>Looking for a technique that will accomplish the same thing in .NET
>
>vb or C#
>
>TIA

Have you looked into reflection?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform