i would like to assign my array vals to properties of my object.
like:
For i = 1 To 32
myClass.Prop_i = val[i]
Next
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
VB.NET isn’t a dynamic language: you can’t do such things.
Since VB.NET doesn’t have a “dynamic” keyword like C#, your option is reflection:
But if you’re more explicit with your problem maybe there’s a more elegant solution than reflection 😉