home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6667 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.2 KB  |  34 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!caen!batcomputer!munnari.oz.au!titan!hal!jbm
  3. From: jbm@hal.trl.OZ.AU (Jacques Guy)
  4. Subject: Re: Comparing record types
  5. Message-ID: <1992Nov17.230223.2113@trl.oz.au>
  6. Sender: root@trl.oz.au (System PRIVILEGED Account)
  7. Organization: Telecom Research Labs, Melbourne, Australia
  8. References: <92316.095144F0O@psuvm.psu.edu> <1992Nov13.001219.588@trl.oz.au> <Bxt7yK.L2H@cs.vu.nl>
  9. Date: Tue, 17 Nov 1992 23:02:23 GMT
  10. Lines: 22
  11.  
  12. sbakker@cs.vu.nl (Bakker S) writes:
  13.  
  14.  
  15. >type aRecord=record x,y,z: integer end;
  16. >     pseudoRecord=packed array [1..SizeOf(aRecord)] of char;
  17. >          ^^^^^^^^^^^^
  18. >var  x,y: aRecord;
  19. >begin x:=y;
  20. >      if pseudoRecord(x)=pseudoRecord(y) then (*....*)
  21. >end.
  22.  
  23. >Now this *will* work, since the runtime code will compare *all* bytes (well,
  24.  
  25.  
  26. Alas, no, it does not work. I have tried it both in TP5.5 and TP 6.0, and
  27. at compile time the error message is the same:
  28.  
  29.       "Operand types do not match operator"
  30.  
  31. But you are right in that other matter: if the first byte of the record is zero,
  32. then the comparison will return "true" always. I hadn't thought of that.
  33.  
  34.