GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Nov-2004, 16:46
leitz leitz is offline
New Member
 
Join Date: Nov 2004
Posts: 20
leitz is on a distinguished road

Removing the " underline pointer?" and advance clrscr()?


1.) I would like to ask how can I remove this "underline pointer" or I dont know what is is called... run this code and you will see that grey underline going around the square...

CPP / C++ / C Code:

#include <iostream.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <windows.h>

int main()
{
 char ch=-1;
  int ba=13;
  while (ch!= 'q')
   {
   int l=0,a=5,b=5;
   while(l<30)
    {
    gotoxy(a,b);
    textcolor(ba);
    cprintf("*");
    a++;
    l++;
   }
   l=0;
   a=5;
   b=25;
   while(l<31)
    {
    gotoxy(a,b);
    textcolor(ba);
    cprintf("*");
    a++;
    l++;
   }
   l=0;
   a=5;
   b=5;
   while(l<20)
    {
    gotoxy(a,b);
    textcolor(ba);
    cprintf("*");
    b++;
    l++;
   }
   l=0;
   a=35;
   b=5;
   while(l<20)
    {
    gotoxy(a,b);
    textcolor(ba);
    cprintf("*");
    b++;
    l++;
   }
  }
 return 0;
}


2.) Is there any comand like clrscr(); but it doesnt delite all screen, just some..like only on "while" sentence or something like that... I would like this square to be drawn and then under a "while" sentence I would get some other stuff like writing some words, and then clearing them - just them, not the sqauare...

I hope anyone can help me!
Last edited by dsmith : 11-Nov-2004 at 17:30. Reason: Please use [c] & [/c] for syntax highlighting
  #2  
Old 11-Nov-2004, 21:41
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by leitz
1.) I would like to ask how can I remove this "underline pointer" or I dont know what is is called... run this code and you will see that grey underline going around the square...

2.) Is there any comand like clrscr(); but it doesnt delite all screen, just some..like only on "while" sentence or something like that... I would like this square to be drawn and then under a "while" sentence I would get some other stuff like writing some words, and then clearing them - just them, not the sqauare...

I hope anyone can help me!

Problem #1: If you aren't using Borland, this will probably not even compile. Since you are using a lot of non-standard functions (cprintf(), gotoxy(), textcolor() for example) you need to let us know what compiler you're using.

Problem #2: If you are going to use the variable ch as the exit to your loop, you might want to try an input or assignment to ch so your program can actually exit.

Solution #3: The function clrscr() clears the screen in Borland. Works fine when I used it.

Info #4: Since you are using all C syntax, there is no need to include #include <iostream.h> and #include <windows.h>. All your I/O is coming from stdio.h and conio.h.

Problem #5:The little grey line I think you're talking about is called a caret now. It used to be a cursor but M$ decided only the mouse pointer is now a cursor. Anyway, there are ways to turn it off but I can't remember at the moment. Try looking in your compiler manuals for functions dealing with cursor and maybe caret
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #3  
Old 12-Nov-2004, 07:23
leitz leitz is offline
New Member
 
Join Date: Nov 2004
Posts: 20
leitz is on a distinguished road
Quote:
Problem #1: If you aren't using Borland, this will probably not even compile. Since you are using a lot of non-standard functions (cprintf(), gotoxy(), textcolor() for example) you need to let us know what compiler you're using.

I have Borland c++.

Quote:
Problem #2: If you are going to use the variable ch as the exit to your loop, you might want to try an input or assignment to ch so your program can actually exit.

I will do that later, but for now this is good for looping all the time for the square...

Quote:
Solution #3: The function clrscr() clears the screen in Borland. Works fine when I used it.

clrscr(); clears all screen... I need some function to clear only part of it...So square stays writen, so I can write that outside of the "while" sentance and it wont be delited...

Quote:
Info #4: Since you are using all C syntax, there is no need to include #include <iostream.h> and #include <windows.h>. All your I/O is coming from stdio.h and conio.h.

Yes I know, I will need those libraries later.

Quote:
Problem #5:The little grey line I think you're talking about is called a caret now. It used to be a cursor but M$ decided only the mouse pointer is now a cursor. Anyway, there are ways to turn it off but I can't remember at the moment. Try looking in your compiler manuals for functions dealing with cursor and maybe caret

I will try some search for caret
  #4  
Old 12-Nov-2004, 23:41
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by leitz
I have Borland c++.
Thought so...


Quote:
Originally Posted by leitz
I will do that later, but for now this is good for looping all the time for the square...
When posting for others to run, you really need to allow the people you ask help of not to wonder why it looks like their computer died, especially when the code explicily states
CPP / C++ / C Code:
while (ch != 'q')
This is like borrowing a friends cooking pot and handing it back to them unclean and greasy.


Quote:
Originally Posted by leitz
clrscr(); clears all screen... I need some function to clear only part of it...So square stays writen, so I can write that outside of the "while" sentance and it wont be delited...
You will probably not be able to do this easily without Borland's manuals and their windows functions. I've never done it myself. If you don't have the documentation, their help files are located at http://info.borland.com/techpubs/bcppbuilder/
Otherwise you might be able to do it thru APIs


Quote:
Originally Posted by leitz
Yes I know, I will need those libraries later.
Ahhh...


Quote:
Originally Posted by leitz
I will try some search for caret
From Borland's help:
Quote:
Originally Posted by Borland
Header File

conio.h

Category

Console I/O Routines

Syntax

#include <conio.h>
void _setcursortype(int cur_t);

Description

Selects cursor appearance.

Sets the cursor type to

_NOCURSOR Turns off the cursor
_NORMALCURSOR Normal underscore cursor
_SOLIDCURSOR Solid block cursor

Note: Do not use this function for Win32s or Win32 GUI applications.

Return Value

None.
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #5  
Old 13-Nov-2004, 06:59
leitz leitz is offline
New Member
 
Join Date: Nov 2004
Posts: 20
leitz is on a distinguished road
Quote:
Originally Posted by Borland

Header File

conio.h

Category

Console I/O Routines

Syntax

#include <conio.h>
void _setcursortype(int cur_t);

Description

Selects cursor appearance.

Sets the cursor type to

_NOCURSOR Turns off the cursor
_NORMALCURSOR Normal underscore cursor
_SOLIDCURSOR Solid block cursor

Note: Do not use this function for Win32s or Win32 GUI applications.

Return Value

None.


I am trying to do with this but cant make it...


BTW:
Here on the http://info.borland.com/techpubs/bcppbuilder/v5/updates/std.html
Are only help files... Where do I get all those librarys and stuff to work with new things like visual stuff,...?
  #6  
Old 13-Nov-2004, 09:20
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by leitz
I am trying to do with this but cant make it...
Bummer. Unfortunately I have no idea what could be wrong without a description of the trouble.

Quote:
Originally Posted by leitz
Quote:
Originally Posted by WaltP
You will probably not be able to do this easily without Borland's manuals and their windows functions. I've never done it myself. If you don't have the documentation, their help files are located at http://info.borland.com/techpubs/bcppbuilder/
Otherwise you might be able to do it thru APIs
BTW:
Here on the http://info.borland.com/techpubs/bcp...dates/std.html
Are only help files... Where do I get all those librarys and stuff to work with new things like visual stuff,...?
My intent was to get you the help files if you didn't have the programmer's manual. If you need more than that, it's probably in your installation already. Otherwize search thru the Borland site for what you need. Borland calls it's Window stuff OWL. The installation of OWL depends on the version of the compiler you have.
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #7  
Old 14-Nov-2004, 06:21
leitz leitz is offline
New Member
 
Join Date: Nov 2004
Posts: 20
leitz is on a distinguished road
Quote:
Originally Posted by WaltP
Bummer. Unfortunately I have no idea what could be wrong without a description of the trouble.

How can I put this in code for no cursor? I am trying some combination, and none worked...
  #8  
Old 14-Nov-2004, 12:53
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by leitz
Quote:
Originally Posted by WaltP
Bummer. Unfortunately I have no idea what could be wrong without a description of the trouble.
How can I put this in code for no cursor? I am trying some combination, and none worked...
FYI the response necessary to "description of the trouble" is not "I want to do this" but "when I tried your suggestion, this happened."
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:45.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.