I agree with Chris's recommendation of Mossenbock's book 'Object-oriented programming in Oberon-2'. I've had my copy since it was published, and it's very useful. There are several used copies available on amazon.co.uk.
Why not post a fragment of your M2 source code, including some of the variant records and the comparison routines? It might make the problem easier to understand. I'm a bit surprised that you don't do all your sorting on variables that are common to the base type. I take this to mean that all the variants have a common subset of the key, but that different variants have different extensions of the key. If so it's a bit more complicated, but it should be feasible.
Bob
_____
From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
Sent: 01 January 2010 19:11
To: BLACKBOX{([at]})nowhere.xy
Subject: Re: [BLACKBOX] Variant Records vs. Component Pascal
Thanks to Douglas and Bob for their quick replies, regarding my problem migrating a database using Modula-2 variant records to Component Pascal. In Modula-2, I had variant records, and was able to use the same sorting routine with each of the variants.
In Component Pascal I tried using a base EXTENSIBLE record, and each of the variant record types as an extension of the base. The problem was that I couldn't pass each of the variants to the sorting routine, and it looked as though I would need a separate sorting routine for each variant.
Douglas's method looks like it would work if indeed I did all my sorting on variables that were common to the base record type, but alas that is pretty limiting. Bob's method looks like it might solve my problem, but I'll have to bang my head with a brick some more to be sure I understand it. Thanks again and Happy New Year to both of you!
Steve Troy
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Fri Jan 01 2010 - 20:37:45 UTC