home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Subject: Re: Variables as names for functions/procedures
- Message-ID: <dmurdoch.67.714772243@mast.queensu.ca>
- Lines: 22
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- References: <1992Aug24.024917.10795@doug.cae.wisc.edu> <1992Aug25.161359.11795@kth.se>
- Date: Tue, 25 Aug 1992 19:50:43 GMT
-
- In article <1992Aug25.161359.11795@kth.se> kjell@elixir.e.kth.se (Kjell Rilbe) writes:
- >
- >Perhaps you can use procedural variables, try this:
-
- > Proc:=ClrScr;
- > Proc;
- > WriteLn('This is normal video');
- > Proc:=HighVideo;
- ..
-
- >There is one limitation, all procedures assigned to the Proc variable
- >must have the same header as the one in the VAR declaration.
-
- There's another irritating limitation: the procedures can't be ones from
- the System unit. Your example works because both ClrScr and HighVideo are
- in CRT, but you can't assign "Sin" or "Cos" or lots of others to procedure
- variables. You need to write your own function which calls the System unit
- function. This is because of the implementation of the System unit: many
- of the procedures aren't true procedures at all, but are compiled into
- inline code.
-
- Duncan Murdoch
-