Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!unmvax!ariel.unm.edu!nmsu!opus!smargari From: smargari@nmsu.edu (Susan Margarit) Newsgroups: comp.sys.mac.programmer Subject: TP wont compile this! Message-ID: Date: 31 Jan 91 05:37:47 GMT Sender: news@NMSU.Edu Distribution: comp Organization: NMSU Computer Science Lines: 38 I cannot get Think Pascal 3.01 to compile this code segment and I'm not sure why. Anybody have any ideas? I'm tired of staring at it. unit DontCompile; interface implementation type DestinationType = record key: packed array[1..10] of char; { actually used to store longint or chars } datum: longint; end; procedure PutLongIntoChars (source: ptr; var dest: DestinationType); {Stick the data pointed to by source into the 'key' field of item.} {Used to put a longint into a packed array[1..10] of char.} type LongPtr = ^Longint; var aLongPtr: LongPtr; begin aLongPtr := LongPtr(@dest.key); { this is the long way of sticking } aLongPtr^ := LongPtr(source)^; {a longint into item.key } LongPtr(source)^ := LongPtr(@dest.key)^; { this compiles but is the reverse of what I want } LongPtr(@dest.key)^ := LongPtr(source)^; { this does not compile! } end; end. Let me know if you have any ideas. Jim.