Thread: Output Help. Buffer Size Maybe?

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    114

    Output Help. Buffer Size Maybe?

    In the snippet of code below i have it output lines to form a box around the console window. But in the very last sqaure on row 26 column 80 when i place a sqaure it pushes
    the text down to the next row. As in.
    What i want:
    ▓------▓
    |------|
    |------|
    |------|
    |------|
    ▓------▓
    What the console window looks like:
    |------|
    |------|
    |------|
    |------|
    ▓------▓

    Im wondering what the problem is. And the ReadString Function is not the source of the problem. I have set the buffer size to X 80 Y 26 and window size to 800 350.

    The objective would be to place a ascii character in that sqaure without it in a way "Pushing the screen down 1 row".

    Code:
    void LoadGwindow()
    {
        int LeftSide = 0;
        int RightSide = 79;
        int TopSide = 0;
        int BottomSide = 25;
        string HLine = "-";
        string VLine = "|";
        char Sqaure = char(178);
        string Corner(&Sqaure, 1);
        //Loading Frame//
         //Top//
         ReadString(HLine,0,78,LeftSide+1,TopSide,2);
         //Bottom//
         ReadString(HLine,0,78,LeftSide+1,BottomSide,2);
         //Left//
         ReadString(VLine,0,24,LeftSide,TopSide+1,1);
         //Right//
         ReadString(VLine,0,24,RightSide,TopSide+1,1);
         //LeftTopCorner//
         ReadString(Corner,0,1,LeftSide,TopSide,1);
         //RightTopCorner
         ReadString(Corner,0,1,RightSide,TopSide,1);
         //LeftBottomCorner
         ReadString(Corner,0,1,LeftSide,BottomSide,1);
         //RightBottomCorner
         ReadString(Corner,0,1,RightSide,BottomSide,1);
    }
    Last edited by Nathan the noob; 10-09-2010 at 09:38 PM.
    Who needs a signature?

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,673
    Why did you cross-post this in C++ and C? This appears to be C++ based on the use of string. And you're complaining about output, but that appears to be strictly an input function.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    It's got nothing to do with your code.

    When you put a character in (or beyond) the last display position in a text console the system scrolls the screen up one line for you... perfectly normal and expected behavior.

  4. #4
    Registered User
    Join Date
    Jun 2008
    Posts
    114
    Yes, And im asking if their is a way to change it.

    Also, This is infact a strictly output function.
    Last edited by Nathan the noob; 10-10-2010 at 04:33 PM.
    Who needs a signature?

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    On text terminals you have to accept that's how they work. When you put in that last character at the bottom right they're going to scroll, it's right in the terminal program.

    Best I can suggest is to leave a border... One or two characters in on each side, one blank line top and bottom.

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    114
    Thats too bad, Well thanks for taking time to respond .
    And yes i will resort to that.
    Who needs a signature?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function call from another .c module
    By Ali.B in forum C Programming
    Replies: 14
    Last Post: 08-03-2009, 11:45 AM
  2. char Handling, probably typical newbie stuff
    By Neolyth in forum C Programming
    Replies: 16
    Last Post: 06-21-2009, 04:05 AM
  3. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  4. error: identifier "byte" is undefined.
    By Hulag in forum C++ Programming
    Replies: 4
    Last Post: 12-10-2003, 05:46 PM
  5. Does anyone Know How to..?
    By kwigibo in forum C Programming
    Replies: 12
    Last Post: 09-20-2001, 08:16 AM