Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!kuhub.cc.ukans.edu!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!s.psych.uiuc.edu!amead From: amead@s.psych.uiuc.edu (alan mead) Newsgroups: comp.lang.pascal Subject: need a little flexibility Message-ID: <1991Apr24.183315.7997@ux1.cso.uiuc.edu> Date: 24 Apr 91 18:33:15 GMT Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 36 Hi. I want to manipulate a data structure in the cleanest way possible (after I write this, I'd like to minimize maintenance time). I've been working with something like this: Block = record x : byte; y : byte; ... data : array[1..252] of byte; end; but the elements of data are sometimes words instead of bytes and this structure doesn't compile (I guess you cannot declare ABSOLUTE structures in a type declaration?): Block = record x : byte; y : byte; ... data : array[1..252] of byte; dataW: array[1..126] of word ABSOLUTE data; end; If it did work, then I could assign words to DataW[ index*2 ] and bytes to Data[] just like Port & PortW and Mem and MemW. But it doesn't. I could declare the variables individually, but that will probably cause confusion (ie, I'd rather use a record, and I don't think I can declare a variable ABSOLUTE to a field in a record, and even then it would be confusing). And a variant record requires an exhaustive listing of it's fields right? Any ideas? Thanks much. -alan : amead@s.psych.uiuc.edu