home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4834 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.3 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!news.ysu.edu!psuvm!frmop11!barilvm!bimacs!ehrlich
  2. From: ehrlich@bimacs.BITNET (Gideon Ehrlich)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: Set question
  5. Message-ID: <4108@bimacs.BITNET>
  6. Date: 12 Aug 92 12:01:03 GMT
  7. References: <19621@plains.NoDak.edu>
  8. Organization: Math department, Bar-Ilan University, Ramat-Gan, ISRAEL
  9. Lines: 39
  10.  
  11. In article <19621@plains.NoDak.edu> jorgense@plains.NoDak.edu (Lee A.
  12. Jorgensen) writes:
  13.  
  14. >Ok, I might be missing something here, but how do I remove a member of a
  15. >set?
  16. >
  17. >I tried two ways:
  18. >
  19. >TYPE ValidChar = set of '0' .. 'z';
  20. >VAR ValidC : ValidChar;
  21. >    a : Char;
  22. >Begin
  23. >  ValidC:=['0','1','2' .... 'x','y','z'];
  24. >                       ^^^^^ --------------This does have ALL
  25. > characters in here
  26. >  a:=chr(49);
  27. >  ValidC:=ValidC-a;
  28.  
  29. ILLEGAL !!!    you should write :    ValidC:=ValidC- [a];
  30.                                                      ^ ^
  31. >--- and ---
  32. >  NewSetC:=ValidC-a;
  33.                    ^
  34.                    ^
  35.  
  36. >where NewSetC is of type ValidChar.
  37. >
  38. >What's am I doing wrong?  The manual isn't too explicit on sets.
  39. >
  40. >Thanks ... Lee.
  41.  
  42. You mixed  types.    a     is an element,    [ a ]    is a set.
  43. The    -     is defined among sets.
  44. >
  45.  
  46. SHALOM        Gideon Ehrlich      ERETZ YISRAEL
  47.  
  48.  
  49.  
  50.