How do I create a linked list inside a type?
Just having 2 variables, where the first points to the first TWareType and the second that points to the last TWareType, isn't really an option, because a station could hold only 2 waretypes, the second one and perhaps the 30th one.
If the 2 vars would point to those 2nd and 30th TWareType, then that station would hold all TWareTypes that come in between too.
Or do you mean, create a TWare type (not a TWareType), let this TWare type have only 3 fields (previous, next and value (= pointer to the TWareType)) and "link" them together, setting up the "previous" and "next" fields as required, to form a chain of TWare type-instances?
And let the station have a pointer to the first TWare type-instance (the start of the chain)?
Edit: Why didn't I think of that?
I remember someone doing this, while reading your post (and replying here).
I've never done this before myself, but thanks that's a great way.
Now all I have to do, is create the system to do all this.
Thanks.
Just having 2 variables, where the first points to the first TWareType and the second that points to the last TWareType, isn't really an option, because a station could hold only 2 waretypes, the second one and perhaps the 30th one.
If the 2 vars would point to those 2nd and 30th TWareType, then that station would hold all TWareTypes that come in between too.
Or do you mean, create a TWare type (not a TWareType), let this TWare type have only 3 fields (previous, next and value (= pointer to the TWareType)) and "link" them together, setting up the "previous" and "next" fields as required, to form a chain of TWare type-instances?
And let the station have a pointer to the first TWare type-instance (the start of the chain)?
Edit: Why didn't I think of that?
I remember someone doing this, while reading your post (and replying here).
I've never done this before myself, but thanks that's a great way.
Now all I have to do, is create the system to do all this.
Thanks.