home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / database / informix / 2315 < prev    next >
Encoding:
Text File  |  1992-11-05  |  1.7 KB  |  43 lines

  1. Newsgroups: comp.databases.informix
  2. Path: sparky!uunet!caen!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!kbrummel
  3. From: kbrummel@magnus.acs.ohio-state.edu (Karl P Brummel)
  4. Subject: Comparing/passing records in 4GL/C
  5. Message-ID: <1992Nov5.152459.5958@magnus.acs.ohio-state.edu>
  6. Sender: news@magnus.acs.ohio-state.edu
  7. Nntp-Posting-Host: top.magnus.acs.ohio-state.edu
  8. Organization: The Ohio State University
  9. Date: Thu, 5 Nov 1992 15:24:59 GMT
  10. Lines: 31
  11.  
  12. Howdy,
  13.  
  14. I'm interested in comparing two entire records at runtime, so I can tell if
  15. one (which started out a copy of the first) is still the same as the first:
  16. i.e., I want to detect if the record has been updated.  I can't do something
  17. like 
  18. if ( rec1 = rec2 ) then...
  19. or 
  20. if (rec1.* = rec2.*) then...
  21. in 4GL, and I don't seem to be able to find a way to pass a pointer to a
  22. record to a C function.  I can pass all the fields with 
  23. call myfunc(rec1.*,rec2.*), 
  24. but then I have to pop all the fields off the stack, which means I have to
  25. know all the fields in the record.  What I want to do is get a pointer to
  26. the first, a pointer to the second, find the size somehow (at run time)
  27. and do a
  28. memcmp(rec1,rec2,sizeof(rec));
  29. or something similar.  The library function field_touched() almost does what
  30. I want, so there must be a way to know this information at runtime.  Any
  31. ideas how I write field_changed()?  Poking through the headers for 4GL
  32. didn't give me any great ideas.  Thanks.
  33.  
  34. Oops, we are running Online 5.0, with tools version 4.10 on a HP9000/832 with
  35. HPUX 8.0.
  36. --
  37.             Karl Brummel -- brumski+@osu.edu
  38.              "Because a mind is a terrible thing."
  39.         "Speed isn't everything...it's the ONLY thing."
  40. -- 
  41.             Karl Brummel---brumski+@osu.edu
  42.       "Mr. MIPS, with the quick handspeed and the bag of tricks."
  43.