|
-
Aug 24th, 2004, 02:13 PM
#1
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|