home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!gatech!usenet.ins.cwru.edu!wariat!sjsobol
- From: sjsobol@wariat.org (Steven J. Sobol)
- Subject: Variant records
- Message-ID: <1993Jan23.140159.10176@wariat.org>
- Organization: APK Public Access
- X-Newsreader: TIN [version 1.1 PL7]
- Date: Sat, 23 Jan 1993 14:01:59 GMT
- Lines: 31
-
- I consider myself a pretty knowledgable Pascal programmer, but there is
- one thing I haven't been able to figure out. When you have a variant
- record such as the following
-
- var Rec : record
- case Boolean of
- ( True: BigNumber: LongInt; )
- ( False: ALongInt: LongInt; )
- end;
-
- how does the computer resolve a reference to Rec.Bignumber as opposed to
- Rec.LongInt? Could I use an ordinal value instead of a Boolean, like this:
-
- var Rec : record
- case Byte of
- ( 0: BigNumber: LongInt; )
- ( 1: ALongInt: LongInt; )
- ( 2: A32BitVal: LongInt; )
- end;
-
- How about an enumerated value?
-
- thanks.
- -s
-
- --
- *** ** ** The Tiny Software Co. Steve Sobol, President sjsobol@tiny.com
- * * * 23707 Glenhill Drive Cleveland, OH 44122 USA
- * * * Cleveland OH 216 691-1169 Home of Top-Quality Shareware And
- * * * Columbus OH 614 793-1835 KNOWLEDGE IS POWER Training Seminars
- * ** ** Freenet: ag510@po.cwru.edu FINGER me at: sjsobol@wariat.org
-