home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / pascal / 8472 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.3 KB  |  42 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!gatech!usenet.ins.cwru.edu!wariat!sjsobol
  3. From: sjsobol@wariat.org (Steven J. Sobol)
  4. Subject: Variant records
  5. Message-ID: <1993Jan23.140159.10176@wariat.org>
  6. Organization: APK Public Access
  7. X-Newsreader: TIN [version 1.1 PL7]
  8. Date: Sat, 23 Jan 1993 14:01:59 GMT
  9. Lines: 31
  10.  
  11. I consider myself a pretty knowledgable Pascal programmer, but there is 
  12. one thing I haven't been able to figure out. When you have a variant
  13. record such as the following
  14.  
  15. var  Rec : record
  16.     case Boolean of
  17.       ( True:  BigNumber: LongInt; )
  18.       ( False: ALongInt: LongInt; )
  19. end;
  20.  
  21. how does the computer resolve a reference to Rec.Bignumber as opposed to
  22. Rec.LongInt? Could I use an ordinal value instead of a Boolean, like this:
  23.  
  24. var  Rec : record
  25.     case Byte of
  26.       ( 0:  BigNumber: LongInt; )
  27.       ( 1:  ALongInt: LongInt; )
  28.       ( 2:  A32BitVal: LongInt; )
  29. end;
  30.  
  31. How about an enumerated value?
  32.  
  33. thanks.
  34.   -s
  35.  
  36. -- 
  37. *** **  ** The Tiny Software Co.   Steve Sobol, President   sjsobol@tiny.com
  38.  * *   *           23707 Glenhill Drive    Cleveland, OH 44122    USA
  39.  *  *  *   Cleveland OH  216 691-1169    Home of  Top-Quality  Shareware  And
  40.  *   * *   Columbus OH   614 793-1835    KNOWLEDGE IS POWER Training Seminars
  41.  * **   ** Freenet: ag510@po.cwru.edu      FINGER me at: sjsobol@wariat.org
  42.