home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pascal / 6764 < prev    next >
Encoding:
Text File  |  1992-11-20  |  1.2 KB  |  37 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!stanford.edu!rock!taco!npstewar
  3. From: npstewar@eos.ncsu.edu (NATHAN PHILLIP STEWART)
  4. Subject: Pointers to functions w/o Turbo
  5. Message-ID: <1992Nov20.155606.2611@ncsu.edu>
  6. Originator: npstewar@c00720-239rd.eos.ncsu.edu
  7. Lines: 24
  8. Sender: news@ncsu.edu (USENET News System)
  9. Reply-To: npstewar@eos.ncsu.edu (NATHAN PHILLIP STEWART)
  10. Organization: North Carolina State University, Project Eos
  11. Date: Fri, 20 Nov 1992 15:56:06 GMT
  12.  
  13.  
  14. I've seen the thread about doing this in turbo, but I couldn't get my problem to
  15. work even in TP6.0, and I'd like to do this on DEC's pascal.  I tried to set up
  16. a function Simps1_3(a,b:real;functionpoint:sometype):real; to integrate Function
  17. Bob(a:real):real; and Function Fred(a:real):real; by Simpson's 1/3 rule.
  18.  
  19. The other thread dealt with this using objects, which aren't supported by this
  20. pascal (to my knowledge), and the other way tried to hide its use of pointers,
  21. but hid it's concept from me as well.
  22.  
  23. 1) How do I find the address of function Bob?  Or howbout system functions like
  24. cos(x)?
  25.  
  26. 2) Can I pass the pointer directly like this?
  27.     Procedure Something;
  28.     ...
  29.     begin
  30.        Al:=Simps1_3(0,Td,@Bob);
  31.     end;
  32.  
  33. 3) Why didn't I learn C in the first place? :-)
  34.  
  35. npstewar@eos.ncsu.edu
  36. Nathan Stewart
  37.