(02-15-2023, 02:43 AM)OldMoses Wrote: An array in an array... could a multi-dimensional array work here? Say, make a two dimensional array of the SlaveAssignmentType, with the first dimension being indexed to the MasterAssignmentType and the second dimension to the NameListType. The order depending upon which is most likely to need REDIMing during use, should that be necessary. REDIMing the second dimension is trivially easy using REDIM _PRESERVE, but REDIMing the first dimension would require a bit more effort; copying, REDIMing then restoring the copy to the original array.
That was how I approached doing an RPG character generator that juggled multiple characters at one time, each of which had multiple data points that each had to be unique to them.
In a nutshell, this is what I am trying to do but I am not seeing how to index the array to two different UDT. Could provide a code snippet on how to create and change elements? I understand what you are say but having a hard time to see how to code it.
On further reflection what you said and it got me thinking. I could index INSIDE the slave file, it just needs to be a standard array and could get large (number of students times number of assignments). I just needed to hear different ideas from different people to think how to make it work. I think this would work.
Code: (Select All)
TYPE MasterAssignmentType 'Needed to populate the top (assignment list)
ARName AS STRING * 20 'Assignment report name
ADName AS STRING * 10 'Assignment display name (short name)
AType AS UNSIGNED BYTE 'Assignment Type (Completeion, formative, summative, etc.)
ACat AS STRING * 20 'Assignment Category (subject, unit, etc)
AColor AS UNSIGNED BYTE 'Color coding assignment headers and for grouping for reports
ACode AS UNSIGNED BYTE 'Reserved
APts AS UNSIGNED INTEGER 'Total points allowed
AID AS INTEGER 'Unique assignment ID
END TYPE
TYPE SlaveAssignmentType 'Needed to fill in the gradebook
UID AS INTEGER 'UID will match the stuedent name list to match results, negative UID means deleted and we will ignore it on display and reports
AID AS INTEGER 'Know which student points are going with each assignmnet
MPts AS UNSIGNED INTEGER 'Points earned for each particular students
Flags AS UNSIGNED BYTE 'See below for codes
Flags2 AS UNSIGNED BYTE ' Reserved
Notes AS STRING * 512 'Comments for a student's work
END TYPE
Adding an assignment ID, I can use the UID and AID like an (X,Y) and print the proper numbers and flags into each box. Thanks for pointing me in the proper direction!