Hi there!
I have a problem resulting in an "array or user-defined type expected" error.
I have two class modules, EventClass and EventArrayClass. I am creating a discrete event simulation, which is not really important right now.
I am trying to sort the EventClass array that is stored in an EventArrayClass object
My EventClass has the following variables:
They are all available trough Get an Let methods:
The EventArrayClass consists of the following variables:
Adding an event to the EventArray goes according to this sub:
This will add the event to the array, while having the array sorted according to the EventTime of the different events.
Now I have a method that will change the EventTime of a certain event, leaving the EventArray unsorted.
Like the following:
Now I want to be able to call a Sub that will sort the Event Array.
I try to do this using the QuickSort algorithm
In the EventArrayClass I have the following two methods:
Calling the sub SortEventArray does no work. It results in an "array or user-defined type expected" error.
I call the sub in the following test method:
To make it complete, the PrintArray in EventClassArray:
I hope someone can help me. I think the problem is in the reference to the EventArray in the method QSortEventArray, but I cant find out why.
I hope the problem is clear. If not let me know.
Help much appreciated!
Bookmarks