Results 1 to 4 of 4

Thread: variable reference in array... strings?

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350

    Question variable reference in array... strings?

    Hi,
    I am trying to access a variable I have stored in ListArray. If I use classes, like this:
    Code:
     MyClass mc = new MyClass();
     MyListArray.Add("mc",mc);
     mc.MyValue = 4;
    everything works, and ((MyClass)MyListArray["mc"]).MyValue is 4.

    However, if I store string (or eg. TimeSpan) like this, (object MyString = "") I can not modify it without creating new copy... and MyString contains something else than (string)MyArray["MyString"]

    How to access my string variable by name?

    Do I have to create my own class for every variable I cannot modify without creating copy?
    Last edited by Jhd.Honza; Aug 24th, 2004 at 02:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width