View previous topic :: View next topic |
Author |
Message |
Laker_Town Retired Number
Joined: 26 Jun 2006 Posts: 25604
|
Posted: Sun Sep 24, 2006 6:54 pm Post subject: two dimnensional arrays IN VB help please.. |
|
|
okay, I have a project due dealing with 2 dimensional arrays but im having trouble with it.
IM not asking for freebie HW, but Im asking for help to understand this better. Mods, If you see fit, feel free to close this thread
Heres my situation:
Ive got to create a program for 10 students and 3 test scores for each student.
Im not sure how to enter values for specific subscripts and then match them with a students name..
ive dimmed strnames (10)
scores(0, 2)
again, IM not asking for the code, but an explanation,pseudo, if you will, about how to figure this thing out.
My plan is to use a listbox to enter the 10 names and then another listbox to enter the 3 scores. but I dont know how to match the scores with the names after that...
I probably didnt make any sense..lol |
|
Back to top |
|
|
Bergamotichek Retired Number
Joined: 02 Sep 2007 Posts: 16777206
|
Posted: Sun Sep 24, 2006 7:09 pm Post subject: |
|
|
<watching closely> |
|
Back to top |
|
|
Laker_Town Retired Number
Joined: 26 Jun 2006 Posts: 25604
|
Posted: Sun Sep 24, 2006 7:10 pm Post subject: |
|
|
i know...i just need an explanation..believe me, id rather understand the concept instead of just ripping it off. |
|
Back to top |
|
|
Mongo Star Player
Joined: 19 Jun 2001 Posts: 2585
|
Posted: Sun Sep 24, 2006 7:44 pm Post subject: Re: two dimnensional arrays IN VB help please.. |
|
|
Laker_Town wrote: | okay, I have a project due dealing with 2 dimensional arrays but im having trouble with it.
IM not asking for freebie HW, but Im asking for help to understand this better. Mods, If you see fit, feel free to close this thread
Heres my situation:
Ive got to create a program for 10 students and 3 test scores for each student.
Im not sure how to enter values for specific subscripts and then match them with a students name..
ive dimmed strnames (10)
scores(0, 2)
again, IM not asking for the code, but an explanation,pseudo, if you will, about how to figure this thing out.
My plan is to use a listbox to enter the 10 names and then another listbox to enter the 3 scores. but I dont know how to match the scores with the names after that...
I probably didnt make any sense..lol |
You are close.
Once you DIMed names and scores (i assume the score dim was a typo)
names(10)
scores(10,3)
just make sure you always use the same index for names and the first index of scores.
names(i)
scores(i,j)
hope that helps |
|
Back to top |
|
|
Laker_Town Retired Number
Joined: 26 Jun 2006 Posts: 25604
|
Posted: Sun Sep 24, 2006 7:54 pm Post subject: |
|
|
okay.. so
scores has 10 rows, 3 columns..
now in order to get the first name's three scores:
name(0)=(0,0),(0,1)(0,2)??
this is not likely the syntax, but is the idea correct?
so the second name would be:
name(1)=(1,0),(1,1),(1,2)? |
|
Back to top |
|
|
Mongo Star Player
Joined: 19 Jun 2001 Posts: 2585
|
Posted: Sun Sep 24, 2006 7:55 pm Post subject: |
|
|
Laker_Town wrote: | okay.. so
scores has 10 rows, 3 columns..
now in order to get the first name's three scores:
name(0)=(0,0),(0,1)(0,2)??
this is not likely the syntax, but is the idea correct?
so the second name would be:
name(1)=(1,0),(1,1),(1,2)? |
You got it. |
|
Back to top |
|
|
Laker_Town Retired Number
Joined: 26 Jun 2006 Posts: 25604
|
Posted: Sun Sep 24, 2006 7:58 pm Post subject: |
|
|
thank you... |
|
Back to top |
|
|
24KaratGold Franchise Player
Joined: 13 Aug 2006 Posts: 17350
|
Posted: Mon Sep 25, 2006 7:44 pm Post subject: |
|
|
yay!
PS What class is this for? _________________ Double rings > Double rainbow |
|
Back to top |
|
|
Addicus Star Player
Joined: 02 Sep 2005 Posts: 9642 Location: Dave's Pimp Palace
|
Posted: Tue Sep 26, 2006 1:34 pm Post subject: |
|
|
I just learned I have no idea what this is about. _________________ Stop crying and start doing.
Twitter: http://www.twitter.com/addicusbrown |
|
Back to top |
|
|
|