Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hello all,

does anyone know if their exists something like the evel function in .net.

 

the problem is that i want to set a variable value that i dont know its name at design time

 

ex:

 

let's say i have a set of variables str1_1, str1_2, str1_3, etc...

i want to set them all in a single for loop

 

for i=1 to 20
     somefunction("str1_" & i) = "somevalue" & i
next

 

in javascript the function is eval

 

is there a way to do that in .net?

Posted

for i=1 to 20
somefunction("str1_" & i) = "somevalue" & i
next

look up 'Invoke'.

 

I'd like to see your actual code as this 'smells' of needing an enumeration and some polymorphic refactoring

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Posted
Maybe you shall look at string array or an ArrayList.

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...