Quote:
1) Why do you have lstMarks and lstNames disabled?
so users cannot click on them and type anything inside them, just to lock them really...is that not the correct way?
2) Why are you adding the entered data to lstSortedMarks and lstSorted Names at data entry time?
what is the alternative - to only sort and output when cmdFind is clicked?? is it deemed bad practice to enter them during data entry time? if yes i will change that, just could do with some expert guidance to determine if its good or bad..here i just need your advise, if its bad i will change it :)
3) You say "i want to improve the program and store the names and marks in 1 record per student". Are you talking about saving the data in a database so that you can use the same data next time or are you talking about just keeping the data together in your program? I ask because your Students array is getting filled with one record for each name which contains a "record" for each name and its associated mark but you aren't doing anything with it except to fill it.
I am talking about just keeping the data together in my program..
Answer: Im a bit confused at this stage aswell, work with me and I am sure we will crack it....I had to first " Create a program for users to enter student’s name and exam mark. When the Add button was clicked, the entered data are added to the arrays and list boxes (one array and list box for names, the other array and list box for marks).
is this done correctly? because I declared the array i.e. "students" in my module, a record is "an element in the array - i.e. studentname or studentmarks - so there are two records in one array" and finally "student(element).studentname is one field in the record of which i have a total of two fields"
BUT I think there maybe an error I have 1 array only, but I need 2, one for names the other for marks....how can I split the current code into two arrays, perhaps I dont need a seperate module at all? im not sure what the "right" way is of doing it..
then I have to:
Improve the program, where the students’ names and marks are stored in a record, rather than arrays - so i think I need to get rid of the "students" array altogether, keep the studentname AND studentmarks elements which are seperate records and possibly can get rid of field i.e. student(element).studentname because I will not be using the array anymore...
IMO I think you just omit "students" plus the "new added" array's of which was "students array" is declared in my module - what do you think? but I am unsure of how you would write the program just using the two records i.e. studentname and studentmarks so that when you click on the cmdadd button it places the student name and mark in 1 record instead of into an array...
The key is to differeniating between arrays and records...so you make 1 version of the program using arrays and another version using records only - which im trying to learn so if apologise if my terminalogy is incorrect...
4) You asked "is there a way of cleaning up the sorting code so that only one sort occurs i.e. marks by descending order whilst keeping the name?" and the answer is yes but to be sure I understand you, if the unsorted data looks like this
I figured it out by duplicating your code and tweaking it but to answer your question, yes - if you were to clean up the code I would want it to look like in your example as it does now after I used your code but its just that I have two versions of your code in my program when I wondered if I could have one copy of it but get it to work as you did below....look at the last project I uploaded this will clarify what I mean by using your code twice...
thanks for your continued help and support your guidance is really helping me...