----- Original Message -----
From: "Horatio B. Bogbindero" <[EMAIL PROTECTED]>
> cool answer. the only caveat here is that it will work with terminals
> that support that clear sequence. other terminals can have different
> clear sequences diba?
yup... the logical thing to do are:
1. get or set environment's TERM variable
2. read /etc/termcap and look for as what you get from TERM's variable or
set it statically on your program the codes as what you set for your TERM
environment.
for you jojo, added bonus, if you want a gotoxy() function for linux
terminal, here is the code:
#include <stdio.h>
void clrscr(void) {
printf("50\E[H\E[J");
}
void gotoxy(int x, int y) {
printf("\E[%i%d;%dH", 0, y, x);
}
int main(void) {
clrscr();
gotoxy(10,20);
printf("happy learning!\n");
return (0);
}
upper left corner is 1,1 and not 0,0
fooler.
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]