home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / pascal / 5090 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  1.5 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!jvnc.net!rutgers!news.columbia.edu!cunixb.cc.columbia.edu!stone
  2. From: stone@cunixb.cc.columbia.edu (Glenn Stone)
  3. Newsgroups: comp.lang.pascal
  4. Subject: procedural types -- a bug in TP?
  5. Message-ID: <1992Aug28.154106.15275@news.columbia.edu>
  6. Date: 28 Aug 92 15:41:06 GMT
  7. Sender: usenet@news.columbia.edu (The Network News)
  8. Reply-To: stone@cunixb.cc.columbia.edu (Glenn Stone)
  9. Organization: Columbia University
  10. Lines: 42
  11. Nntp-Posting-Host: cunixb.cc.columbia.edu
  12.  
  13. This seems to dumb, I'm sure I'm missing something right under my nose.  
  14. But anyway:
  15.  
  16. I want to use a procedural type but my compiler (TP 5.5) objects.  So
  17. I copied the example right out of the manual (Ref Guide 5.0, p. 85 --
  18. I've paraphrased it a bit):
  19. ------------------------------------------------
  20. type
  21.    proc = procedure (var x,y : integer);
  22.  
  23. var
  24.    p : proc;
  25.  
  26. {F+}
  27. procedure swap (a,b : integer);
  28.    begin
  29.    end;
  30. {F-}
  31.  
  32. begin
  33. p := swap;
  34. end.
  35. ------------------------------------------
  36.  
  37. The compiler stops on the "p := swap" line and says
  38.  
  39. Error 143: Invalid procedure or function reference
  40.  
  41. Is this a bug, am I making some colossally stupid mistake, or am I in
  42. the Twilight Zone?
  43.  
  44. Thanks,
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. -------------------------------------------------------------------------
  52.   Glenn Davis Stone                                BITNET: stone@cunixf
  53.   Columbia University            INTERNET: stone@cunixb.cc.columbia.edu
  54. -------------------------------------------------------------------------
  55.