I have created a structure, MyStruct, with 3 properties: Name (String), Valid (Boolean) and Type (Enumeration Type).
I need to do the following:
1. Create a list of items of type MyStruct using a simple method like:
MyStruct.Add(...)
2. Access each list item using a For Loop.
Could someone, please help me out?
I have been trying collections, arrays, adding methods inside my structure but I have not been able to make this work.
Thank You Very Much,
Miguel
shapper:
Hello,
I have created a structure, MyStruct, with 3 properties: Name (String), Valid (Boolean) and Type (Enumeration Type).
I need to do the following:
1. Create a list of items of type MyStruct using a simple method like:
MyStruct.Add(...)
Rather Use Classes where you can have the above 3 properties & also get Methods Like Add() ,Delete() etc.Then Create an Array of that Class.
2. Access each list item using a For Loop.
When u make the Array of a Class u can use the For/ForEach loops to access the element of the array.
Could someone, please help me out?
I have been trying collections, arrays, adding methods inside my structure but I have not been able to make this work.
Thank You Very Much,
Miguel
0 comments:
Post a Comment