Type ThisPatExamsForUpload (ULpat As PatientStruct, ULexam() As Exam)
Which contains patient data, and a bunch of exams for that patient - there could be any number of exams.
When I try populate the instance, I get a exception when I try initialise the first ULexam() - ArrayIndexOutOfBounds.
I understand the error occurs as PatAndExams.ULexam(0) does not exist yet. How can I create ULexam(0) and subsequent exams in that array in order that they can be initialised?
Thanks.
Well this chunk of patients and exam data needs to be sent to a PC and then unpacked into a database on the PC, and with my programming skills not being very strong, I thought I'd start simple - and arrays seem the simpler data type, and I probably stand the best chance of ending up with a well defined structure to transport.
I may be completely wrong on my approach and have to do something completely different.. living and learning
Thanks.
Well this chunk of patients and exam data needs to be sent to a PC and then unpacked into a database on the PC, and with my programming skills not being very strong, I thought I'd start simple - and arrays seem the simpler data type, and I probably stand the best chance of ending up with a well defined structure to transport.
I may be completely wrong on my approach and have to do something completely different.. living and learning
If your type has only two fields and one is an unique ID, you may also use a map. Instead of:
Type ThisPatExamsForUpload (ULpat As PatientStruct, ULexam As List)
Dim TPEfU(10) as ThisPatExamsForUpload
...
you could have:
Dim PatExamsForUpload as Map
PatExamsForUpload.Put(ULpat, ULExam)