Newsgroups: comp.lang.pascal
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!umich!sharkey!tygra!dave
From: dave@tygra.UUCP (David Conrad)
Subject: Re: CTRL-Characters
Organization: CAT-TALK Conferencing System, Detroit, MI
Date: Mon, 1 Apr 91 08:27:35 GMT
Message-ID: <1991Apr1.082735.9323@tygra.UUCP>
References: <1991Mar27.160905.1962@cs.mcgill.ca> <1991Mar27.161213.2100@cs.mcgill.ca> <1991Mar30.081820.8305@cs.mcgill.ca>

In article <1991Mar30.081820.8305@cs.mcgill.ca> einstein@cs.mcgill.ca (Michael CHOWET) writes:
>In article <1991Mar27.161213.2100@cs.mcgill.ca> storm@cs.mcgill.ca 
>(Marc WANDSCHNEIDER) writes:
>
>>How do I make a PASCAL program recognize CTRL characters (or ALT characters 
>>for that matter).  Ie I want the following:
>
>>     IF CH = CTRL-G then 
>>          BEGIN 
>>           blahblahb
>>	  END;
>
>  Actually, there are two ways to get at this. If you feel like dragging out
>the list of ASCII codes, you can type:
>
>  If CH = #07 Then DoSomething ; 
>
>  Basically, the # symbol followed by the ASCII code. Simple enough, right?
>
>  But if you want the actual character in there, hit the ^P. The following
>character (your CTRL-char) will be accepted as a literal, ie it will be
>inserted into the text without trying to process it as an editor control key.
>
>  Hope that helps.

This is rather ambiguous.  "If ch = 'G' then" works where "G" is a control
character entered by pressing CTRL-P CTRL-G.  But "If ch = G then" where
"G" is once again a control character will not even compile.  The former,
which does work, will probably not print, though.  One that works and
can be sent to the console or printer is "If ch = ^G then" or the above-
mentioned "If ch = #7 then".

Dave Conrad
dave%tygra@sharkey.cc.umich.edu
-- 
=  CAT-TALK Conferencing Network, Computer Conferencing and File Archive  =
-  1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new'    - 
=  as a login id.  AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET")        =
   E-MAIL Address: dave%tygra@sharkey.cc.umich.edu
