Skip to content

How to create a variable at runtime ?

utsav rathour

Asked May 10, 2008, 1:23 AM EDT2 answers
Share
LinkedInX

i need to create a variable at runtime which checks for existing variables and creates new.

eg ::  if  var1 exists then create var2.  like on.

and should be killed once the program is closed?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    0
    if(Condition with  var1...)
    {
         using(var2 oVar = new var2())
         {
               //TODO: Some code here with var2, of corse var2 must implement the IDisposable     interface before
         }
    }
    0
  • 1 short reply
    • 0
      thankx i'll have a look at it
      0