home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / pascal / 5047 < prev    next >
Encoding:
Text File  |  1992-08-25  |  1.3 KB  |  34 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
  3. From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
  4. Subject: Re: Variables as names for functions/procedures
  5. Message-ID: <dmurdoch.67.714772243@mast.queensu.ca>
  6. Lines: 22
  7. Sender: news@knot.ccs.queensu.ca (Netnews control)
  8. Organization: Queen's University
  9. References: <1992Aug24.024917.10795@doug.cae.wisc.edu> <1992Aug25.161359.11795@kth.se>
  10. Date: Tue, 25 Aug 1992 19:50:43 GMT
  11.  
  12. In article <1992Aug25.161359.11795@kth.se> kjell@elixir.e.kth.se (Kjell Rilbe) writes:
  13. >
  14. >Perhaps you can use procedural variables, try this:
  15.  
  16. >  Proc:=ClrScr;
  17. >  Proc;
  18. >  WriteLn('This is normal video');
  19. >  Proc:=HighVideo;
  20. ..
  21.  
  22. >There is one limitation, all procedures assigned to the Proc variable
  23. >must have the same header as the one in the VAR declaration.
  24.  
  25. There's another irritating limitation:  the procedures can't be ones from 
  26. the System unit.  Your example works because both ClrScr and HighVideo are 
  27. in CRT, but you can't assign "Sin" or "Cos" or lots of others to procedure 
  28. variables.  You need to write your own function which calls the System unit 
  29. function.  This is because of the implementation of the System unit:  many 
  30. of the procedures aren't true procedures at all, but are compiled into 
  31. inline code.
  32.  
  33. Duncan Murdoch
  34.