Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site whuxl.UUCP Path: utzoo!watmath!clyde!cbosgd!cbdkc1!desoto!packard!hoxna!houxm!whuxl!mike From: mike@whuxl.UUCP (BALDWIN) Newsgroups: net.lang.c Subject: Re: CTRL(X) in ANSI standard Message-ID: <628@whuxl.UUCP> Date: Wed, 8-May-85 03:45:44 EDT Article-I.D.: whuxl.628 Posted: Wed May 8 03:45:44 1985 Date-Received: Thu, 9-May-85 00:47:58 EDT References: <10425@brl-tgr.ARPA>, <621@whuxl.UUCP> <5569@utzoo.UUCP> Organization: AT&T Bell Laboratories, Whippany Lines: 24 > > [use '\^X' instead of CTRL(x) or CTRL('x')] > As has been said before, the right way to do this is: > #define BEL '\007' I was thinking mainly about programs that use curses or otherwise read characters one at a time and do special things with ctrl chars. E.g., switch (c) { case '\^U': /* up code */ case '\^D': /* down code */ Etc. #define's (other than CTRL) just won't do. And the #define for CTRL moves around, so you have to use #ifndef. Glick. Also, it is easier to think in terms of ctrl chars rather than their octal values when dealing with funny terminal sequences. For instance, the cursor motion sequence on mime's is ^T row col, and using printf("\^T%c%c", row, col) is a bit more obvious than printf("\024%c%c", row, col). Michael Baldwin AT&T Bell Labs harpo!whuxl!mike