Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multi-dimensional arrays
Message
From
14/07/2002 17:57:10
 
 
To
14/07/2002 17:24:20
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00678465
Message ID:
00678529
Views:
17
All good ways of coding it, Claudio ... I think I like your first example best.

~~Bonnie


>well, I went for this sort of way... the more close I can come for VFP is this:
>
>
>object[,] persons = new object(4,2)
>
>persons[0,0] = 25;
>persons[0,1] = "John";
>persons[1,0] = 30;
>persons[1,1] = "Paul";
>persons[2,0] = 50;
>persons[2,1] = "Mark";
>persons[3,0] = 10;
>persons[3,1] = "Matt";
>
>Console.Write( persons[1,0] + " " + persons[1,1] )
>
>
>But we can do this (a little bit different from what Gérald has shown first):
>
>
>// Instead of assigning the values by columns, I assign by rows)
>
>object[,] persons = {{25,"John"},{30,"Paul"},{50,"Mark"},{10,"Matt"}}
>
>
>Or, I think this one is a little more cleaner and readable:
>
>
>object[,] persons = {{25,"John"},
>                     {30,"Paul"},
>                     {50,"Mark"},
>                     {10,"Matt"}}
>
>
>So, we can access an element just like in VFP. Anyway, if decided to go for the methods to "set" and "get" values, I saw that there´s already native methods for that: SetValue and GetValue (still didn´t study a lot on this...)
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform