Original Usenet thread from alt.ascii-art.animation, started 27 Feb 1994.
_ _ _ _ _ _ | | | |___ ___ _ __ ___| |_ / \ _ __ ___| |__ (_)_ _____ | | | / __|/ _ \ '_ \ / _ \ __| / _ \ | '__/ __| '_ \| \ \ / / _ \ | |_| \__ \ __/ | | | __/ |_ / ___ \| | | (__| | | | |\ V / __/ \___/|___/\___|_| |_|\___|\__| /_/ \_\_| \___|_| |_|_| \_/ \___|
Where can I find the control codes for VT100 terminal ?
alt.ascii-art.animation
· 7 messages · 27 Feb 1994 - 1 Mar 1994
I am going to write a C program which ought to print characters on screen for an experiment on Short Term Memory test. Since the program need to place the char at random position on screen and then erase the char; I need to printf() some control codes. I don't have information on the control chars for terminal (I guess the vt100 is the most common one). Can anyone send me a pointer on "where can I ftp the necessary information" ? Mr.WONG Sai Kee Graduate Student (NeXTMail Welcome)
skw...@cuse1.se.cuhk.hk (Wong Sai Kee (Graduate Assistant)) writes: | Since the program need to | place the char at random position on screen and then erase the char; I need | to printf() some control codes. I don't have information on the control | chars for terminal (I guess the vt100 is the most common one). | This may be overkill for what you want, but the "curses" library provides for term-type-independent code, instead of restricting yourself to (say) vt100. "man 3v curses". (Never used it myself, don't know how much is involved in figuring out what's needed.) ian
Thanks, I got reply from Ernest Yik, Michael Chan, Kirby. Now, I am using the curses. SK
ian barland (boy wander) (ia...@cse.ucsc.edu) wrote: : skw...@cuse1.se.cuhk.hk (Wong Sai Kee (Graduate Assistant)) writes: : | Since the program need to : | place the char at random position on screen and then erase the char; I need : | to printf() some control codes. I don't have information on the control : | chars for terminal (I guess the vt100 is the most common one). : | : This may be overkill for what you want, but the "curses" library : provides for term-type-independent code, instead of restricting yourself : to (say) vt100. "man 3v curses". (Never used it myself, don't know how : much is involved in figuring out what's needed.) : ian i used curses a bit last year and it seems ok - its a bit fiddly to start up but after that its rather simple to use (you can even make yourself some menus and use different terms (as you said)) nick.
In article <CLvKGr.M1r@eng_ser1.ie.cuhk.hk> skw...@cuse1.se.cuhk.hk (Wong Sai Kee (Graduate Assistant)) writes: I am going to write a C program which ought to print characters on screen for an experiment on Short Term Memory test. Since the program need to place the char at random position on screen and then erase the char; I need to printf() some control codes. I don't have information on the control chars for terminal (I guess the vt100 is the most common one). Can anyone send me a pointer on "where can I ftp the necessary information" ? If you're writing it for use on Unix, you should be using either the termcap or terminfo libraries to obtain the desired command strings. DO NOT EMBED TERMINAL COMMAND CODES IN YOUR PROGRAM. That only causes trouble for everyone else who doesn't have whatever flavor of terminal you used as your model. The termcap and terminfo libraries provide very simple functions for obtaining and using the full range of terminal control strings. Use them, and your program will work on ANY terminal, for which a termcap or terminfo description exists. (I.e. nearly everything, or someone can easily create one.) Curses could be overkill, but you're welcome to try it if you like. The problem with it is that there are at least two incompatible versions of curses out there, and most vendor's implementations (to my experience) are buggy in various places. Good Luck! -- Edwin Wiles | Sterling Software, Inc. ITD | Vienna, VA, USA Preferred..: ewi...@vienna.itd.sterling.com GCS d--@ -p+ c++(++++) l u++ e- m+(++) s+/ n-(+) h--- f g+ w+ t+ r(+) y?
In <2kr05v$11...@darkstar.UCSC.EDU>, ia...@cse.ucsc.edu (ian barland (boy wander)) writes: >skw...@cuse1.se.cuhk.hk (Wong Sai Kee (Graduate Assistant)) writes: >| Since the program need to >| place the char at random position on screen and then erase the char; I need >| to printf() some control codes. I don't have information on the control >| chars for terminal (I guess the vt100 is the most common one). >| >This may be overkill for what you want, but the "curses" library >provides for term-type-independent code, instead of restricting yourself >to (say) vt100. "man 3v curses". (Never used it myself, don't know how >much is involved in figuring out what's needed.) the curses man page i've looked through is pretty huge... but VERY nice to learn. it's very flexible, etc, once you find your way around it... as for the ANSI escape codes, you can do movement with: ^[[x;yH where '^[' is the ESCAPE charachter... (ascii 27?) 'x' and 'y' are integer coordinates on the screen, and '[' and 'H' are constants another way to do it would be to use \r in your printf. that SHOULD take you to the beginning of the line, as i recall... (though i got used to that on a system that's far from standard, so i could be wrong) enjoy... good luck. david lindes lin...@asd.sgi.com #include <std_disclaimer.h>
In article <CLvKGr.M1r@eng_ser1.ie.cuhk.hk>,
Wong Sai Kee (Graduate Assistant) <skw...@cuse1.se.cuhk.hk> wrote:
[ request deleted. ]
well, all you realy need is...
(esc)[Y;Xm I think...
so the program will look like this... [ where (esc) is printed , put the escape
character. How you do that is dependent on the editor you use. ]
.
.
.
printat (int X,int Y);
{
printf("%s%d%c%d%c%s","(esc)[",Y,';',X,'m',"String to print");
}
assuming here that X and Y are the right way around. [ its been a while since
I did this] and that X and Y are generated elsewhere this should work.
hope this helps.
I think I tried mailing this to you, but our mail server couldn't find you.
]\/[as!
=* mail nma...@rowan.cov.ac.uk and brighten his day and yours *=*=*=*=*=*=*=*=
"Very irritating habit I know. ] "Don't you just love the ["half of what
It's next on my list for giving ] smell of C4 in the morning?"[I say is
up after smoking and leeches" (Reg. DGHDA) =*=*(3x3 Eyes)=*=*=* meaningless" =
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
__
\ \ _ _
\**\ ___\/ \
X*#####*+^^\_\
o/\ \
\__\ .------------. |\\//\\//\\//| |//\\//\\//\\| |\\//\\//\\//| |//\\//\\//\\| '------------'
_______ /` _____ `\;, /__(^===^)__\';, / ::: \ ,; | ::: | ,;' '._______.'`jgs
_ _ (o)(o)--. \../ ( )hjw m\/m--m'`--.
_ _
/` \/ `\_ _
\ /` \/ `\
'. .\ /
\/ '. .'
\/jgs __ . . __ (o.\ \/ /.o) \__\/\/__/ /O /==\ O\ (;O/ \/ \O;)
Make your own ASCII art
Turn images, text or 3D into ASCII, or draw your own – right in your browser.
About this thread.
These messages were posted publicly to the newsgroup
alt.ascii-art.animation
in 1994 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked.
The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can.
Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.
Report this message
Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.