help with two arrays of records 
Author Message
 help with two arrays of records

I have two arrays of records, one with students data and another one with
information about courses. If I want to register a new student to a course,
how can I combine the two arrays into one? So far I've only worked with one
item, never with two and I don't know how to go about it... Will I have to
create a third array of records, combining the two or what other way can I
achieve this?


Thu, 07 Aug 2003 02:33:52 GMT  
 help with two arrays of records

Quote:
> I have two arrays of records, one with students data and another one with
> information about courses. If I want to register a new student to a course,
> how can I combine the two arrays into one? So far I've only worked with one
> item, never with two and I don't know how to go about it... Will I have to
> create a third array of records, combining the two or what other way can I
> achieve this?

   First, you should ask yourself (and explain to us) what your purpose
is in "combining" the arrays: what are you trying to achieve?
   If, as seems indicated by your post, you're only trying to flag each
student's record with the course(s) he/she has selected, then why
"combine" the 2 data arrays?  Why not instead have information in the
Courses record (e.g. Number) that gives a value which can be used to
access the other information (such as Name, Teacher, Rooms, etc.)?  Doing
something as simple as storing the Course_Number into the Student records
would allow you to access all the other information about the course,
right?
   Then it's a matter of defining the Student record with the appropriate
data needed for each student, as well as one or more slots for
Course_Numbers (perhaps an array of them, within the Student record
type).  As each student is processed (to select valid courses, put them
into a "schedule", pay for them, whatever), all that is stored in the
Student record is that Course_Number value.
   There's no value, it appears, in "combining" all the data in the two
arrays, but it's far better to "link" them in some way - so that various
lists can be produced for whatever purposes are deemed necessary.  For
that matter, it might be useful (depending on how sophisticated you want
this homework assignment to become) to have an array of "Student_Ids"
within the Courses records - so you can link the courses back to the
students who registered for them.
   If this doesn't help you (by forcing you to think about what you're
really needing to do and get you started), I suggest you post your actual
assignment so we can see what you're talking about in this post...


Thu, 07 Aug 2003 23:53:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help with two arrays of records

2. Two D array help needed.

3. help adding and deleting records from arrays

4. Array and Records help!!

5. Array record: HELP!!!!

6. //Help with an array of records in BASM//

7. adding/deleting records from array of records in .dat file

8. Need help saving a record with arrays.

9. need helping sorting arrays of records

10. Adding two multi-dimensional arrays

11. Two arrays of 45 kb. each

12. Creating two-dimensional arrays in Delphi 1

 

 
Powered by phpBB® Forum Software