Ok, now this newbie is dealing with arrays.
I have some questions on this. I thought I'd use the built in Array class,
since it contains all I need for sorting, copying etc. arrays. Now I'm
wondering if this is so clever. As I've understood it, one good thing with
the Array class is that it is partly dynamical, since there is a function
for adding elements to the array, although it thtows an exception...
But what I'm having the real problems with is to access the values in the
created array ...
For Example
class class1
{
private String string1;
public String string2;
public String GetString1() { return string1;}
}
// and in the Main()
Array myArray = Array.CreateInstance(typeof(class1), 50); // No
errors/problem this far ....
// Here I'd like to get/set value of String1, HOW ?
//--------------------------------------------------------------------------
--
// The way I can think of is like this
class1 myVar = new class1();
myVar.string2 = "blablabla";
myArray.SetValue(myVar, 5);
//--------------------------------------------------------------------------
--
// But how do I make a function call in class1 in the array ? I can't figure
out how to it with ex. GetValue() ...
2. If the above is solved, how do I sort the Array using Sort() ?
If I'd for example like to sort it alphabetically on string1 ...
TIA (again)