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