Thread View: comp.std.c
2 messages
2 total messages
Started by Stan Novinsky
Fri, 19 Apr 1996 12:19
Embedded Eacape Sequences ?
Author: Stan Novinsky
Date: Fri, 19 Apr 1996 12:19
Date: Fri, 19 Apr 1996 12:19
32 lines
1398 bytes
1398 bytes
I have a program that I wish to have some escape sequences defined and used. The escape sequences will work on a VT emulation terminal I am using. For instance, I want to place the cursor at the top left corner of my terminal screen with ESC//'[01;01H'. This works in FORTRAN by defining the ESC = CHAR(27) TOPL = ESC//'[01;01H' When a FORTRAN type statement is issued, the cursor moves to the top left portion of the screen. Is it possible to do this in C and if so, how is the sequence defined and used ??? Thanks stan_novinsky@jhuapl.edu ******************************************************************* * System Configuration: * * VAXstation 4000/90 * * OpenVMS 6.1 * Oracle 7.1, Forms 4.0 * 3 RZ28's * *******************************************************************
Re: Embedded Eacape Sequences ?
Author: Bill Spitzak
Date: Sat, 20 Apr 1996 16:39
Date: Sat, 20 Apr 1996 16:39
34 lines
1451 bytes
1451 bytes
Stan Novinsky <stan_novinsky@jhuapl.edu> writes: >I have a program that I wish to have some escape sequences >defined and used. The escape sequences will work on a >VT emulation terminal I am using. >For instance, I want to place the cursor at the top left >corner of my terminal screen with ESC//'[01;01H'. >This works in FORTRAN by defining the > > ESC = CHAR(27) > TOPL = ESC//'[01;01H' You can put these characters in string constants and then print them. The main secret is that the ESC character is '\033' or equivalently '\x1b' or char(27). The closest equivalent to the above in Ansi C would be: #define ESC "\033" const char *topl = ESC"[01;01H"; Since this depends on the string constant appending which you might not have, just doing: const char *topl = "\033[01;01H"; might be what you want. You are likely to get a lot of messages saying "use curses" or other things to that effect. Just ignore them, that is obviously not what you want. Bill
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads