delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/25/10:30:10

From: "A. Sinan Unur" <asu1 AT c-o-r-n-e-l-l DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP with CONIO.H
Date: 25 Feb 2003 15:20:04 GMT
Organization: Cornell University
Lines: 63
Sender: asu1 AT cornell DOT invalid (on pool-141-149-206-175.syr.east.verizon.net)
Message-ID: <Xns932D69213E175asu1cornelledu@132.236.56.8>
References: <6a5a8fa116bf7cfe3195a3dd08958be4 DOT 113557 AT mygate DOT mailgate DOT org>
NNTP-Posting-Host: pool-141-149-206-175.syr.east.verizon.net
X-Trace: news01.cit.cornell.edu 1046186404 9336 141.149.206.175 (25 Feb 2003 15:20:04 GMT)
X-Complaints-To: usenet AT news01 DOT cit DOT cornell DOT edu
NNTP-Posting-Date: 25 Feb 2003 15:20:04 GMT
User-Agent: Xnews/5.04.25
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"helen" <lab_darzo AT libero DOT it> wrote in 
news:6a5a8fa116bf7cfe3195a3dd08958be4 DOT 113557 AT mygate DOT mailgate DOT org:

> I have DJGPP working fine even with allegro.
> it's on win98.
> 
> I run this and a blank screen goes. why ? (see below)
> ---
> /*    parabola non centrata nell'origine */
> 
> #include <stdio.h>
> #include <math.h>
> #include <conio.h>
> 
> int main()
> {
> int h,w;
>   clrscr();

this clears the screen.

>      h=300;
>      w=200;
>         gotoxy(120,350);

this is definitely out of bounds for text mode (80x25).

>         textcolor(4);
>         printf("il testo  in 120,350\n");

you shouldn't mix stdio functions with conio functions. so, you should 
have used cprintf here. however, since you set the output coordinates to 
somewhere beyond the textmode screen, that would have probably crashed 
your program.

>         getchar();
> 
>    // ORA DISEGNO LA FINESTRA...
>    textbackground(4);
>       window(10, 20, 10+w, 20+h);

again, this window spans an area larger than the text mode screen.

>          getchar();
>    return 0;
> }
> 
>  I suppose conio.h is not linked or the RHIDE is not well configured.
> any help ???

header files are not linked, they are #include'd. I think the conio 
functions are in the DJGPP libc, so they would be linked automatically. 
The answer is simple, the screen is cleared because you called clrscr().

It is probably not a good idea to try to draw a parabola in text mode.

Sinan.

-- 
A. Sinan Unur
asu1 AT c-o-r-n-e-l-l DOT edu
Remove dashes for address
Spam bait: mailto:uce AT ftc DOT gov

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019