\B...No Front??

This is a discussion on \B...No Front?? within the C Programming forums, part of the General Programming Boards category; I realize that "\b" will get me back a space, but is there any way possible to space forward without ...

  1. #1
    Registered User SavesTheDay's Avatar
    Join Date
    Jan 2002
    Posts
    77

    Question \B...No Front??

    I realize that "\b" will get me back a space, but is there any way possible to space forward without erasing the current characters that are already there?

    Code:
    a=Percent[b]
    
    if (p>=0)  {
         
         while(c>d)  {
              printf(i need to forward space x amount of times here);
                           }
    
         printf("%c",a);
    
         while(e>f)  {
              printf("\b");
                           }
    
                    }
    That is pretty much the code where I need the forward spaces....I need to space forward without erasing what is already there, then space back to the original position. Anything?

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    \t is tab
    Monday - what a way to spend a seventh of your life

  3. #3
    Registered User SavesTheDay's Avatar
    Join Date
    Jan 2002
    Posts
    77
    Yes....but will Tab erase the characters already there or just tab the cursor over? Isn't tab 5 or 6 spaces? No way to just go one space?

  4. #4
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    i dont think it erases characters, there may be a way to print a non-breaking space
    Monday - what a way to spend a seventh of your life

  5. #5
    Registered User SavesTheDay's Avatar
    Join Date
    Jan 2002
    Posts
    77

    Cool

    It actually does move the characters with the tab....but....there is a bunch of escape sequences that ANSI C uses to hold a cursors position....for example:

    Code:
    printf("Come Back Now \033[S");
    printf("\b\b\b\b");
    printf("C\033[U or else);
    The 4 \b's go back and put the cursor on the N which is changed to C...then the cursor is shifted forward to where the drop off point was so the final output would be "Come Back Cow or else"....excellent.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. front audio panel
    By crvenkapa in forum Tech Board
    Replies: 1
    Last Post: 12-09-2007, 01:00 PM
  2. adding an item to the front of the queue
    By asem0525 in forum C Programming
    Replies: 8
    Last Post: 12-02-2006, 05:21 AM
  3. Queue and Stack: Comparing help!!! (palindrome)
    By advocation in forum C++ Programming
    Replies: 8
    Last Post: 03-09-2005, 08:46 PM
  4. Removing from the front of a Vector
    By Zildjian in forum C++ Programming
    Replies: 1
    Last Post: 09-11-2004, 11:49 AM
  5. Bringing an Application to the Front in XP
    By Davros in forum Windows Programming
    Replies: 5
    Last Post: 11-25-2003, 10:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21