Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Virtual Console Backspace Character? (http://www.chiefdelphi.com/forums/showthread.php?t=84385)

Geek 2.0 18-03-2010 01:22

Virtual Console Backspace Character?
 
This isn't all that important, but it's a curious thing for me... Is there a backspace command we can send to the Virtual Console to backspace the last character sent? I tried "\b" but it didn't work...

Again, it's not important, but ever since the build season ended, programming (outside of competitions, that is) has been rather dull, so I'm adding "fun" code. (and yes, I realize the danger of this)

Robototes2412 18-03-2010 18:38

Re: Virtual Console Backspace Character?
 
The standard linux escape list can be shown here:

List of escaped characters

Yes, im referencing an AWK manual, but it has the list I use all the time.

The closest character to it is a space because there is to backspace escaped sequence. It is interpreted by the scanf, raw_input, readline, or whatever function your language of choice uses to get input from the user.

A word of advice: fun code blows up speed controllers

LukeS 24-03-2010 21:34

Re: Virtual Console Backspace Character?
 
'\b' for backspace should work, however, it will not be able to delete a newline, so you may have problems with println appending newlines. Though, I haven't tried this on the cRIO or anything.

And when messing around be careful, but hey anything worth doing has some risk. :)

Geek 2.0 25-03-2010 12:03

Re: Virtual Console Backspace Character?
 
Quote:

Originally Posted by LukeS (Post 942852)
'\b' for backspace should work, however, it will not be able to delete a newline, so you may have problems with println appending newlines. Though, I haven't tried this on the cRIO or anything.

And when messing around be careful, but hey anything worth doing has some risk. :)

Yeah, I tried '\b' but it didn't work. Really, all I was trying to make was a "spinning" line, with |, \, -, and / looping so that it created the illusion that it was spinning. Now this might seem pointless, but there actually was a reason... I was getting sick of the disabled loop spitting out endless lines of code, yet I wanted a way to tell if it was still reading from the cRIO. Not important though. I might look at it more in my spare time (as if I have any now).

TubaMorg 25-03-2010 12:23

Re: Virtual Console Backspace Character?
 
Are you talking about the driver station console? If so it is treated analogous to the LCD screen of last year which means you are essentially "painting" characters on the screen. To delete characters you have to output a space at that position.

Example:

"here is some text"
to just say 'here' you would have to output
"here "
to erase the entire line:
" "

So for your thing instead of backspace:
"|"
" "
"\"
" "
"-"
" "
"|"
etc.....

Also keep in mind that an update signal must be sent each time the LCD text is set or it won't appear animated.

If I am totally misunderstanding what you are trying to do...apologies!
You can try a unicode backspace too: \u0008

LukeS 25-03-2010 17:00

Re: Virtual Console Backspace Character?
 
Quote:

Originally Posted by TubaMorg (Post 943098)
Are you talking about the driver station console? If so it is treated analogous to the LCD screen of last year which means you are essentially "painting" characters on the screen.

I think he's talking about the `System.out' (stdout in non-Java lingo) stream--In Netbeans, and you click run, the output box will start streaming stdout from the cRIO once it is done compiling.

Although, We have found that unless you need more than 21 columns per line (the physical size of last year's LCD), using the text area on the driver station is better for just about everything. If certain aspects of it are a pain, borrow our LCD.java from our code.

Quote:

Originally Posted by Geek 2.0 (Post 943091)
Yeah, I tried '\b' but it didn't work. Really, all I was trying to make was a "spinning" line, with |, \, -, and / looping so that it created the illusion that it was spinning. Now this might seem pointless, but there actually was a reason... I was getting sick of the disabled loop spitting out endless lines of code, yet I wanted a way to tell if it was still reading from the cRIO. Not important though. I might look at it more in my spare time (as if I have any now).

Hey you don't need to explain the importance of a baton to me.

Joe Hershberger 26-03-2010 00:12

Re: Virtual Console Backspace Character?
 
It's a console, right? So why not try the backspace? Have you tried ctrl-h (0x08)?

-Joe

Robby Unruh 28-03-2010 19:00

Re: Virtual Console Backspace Character?
 
Quote:

Originally Posted by Joe Hershberger (Post 943312)
It's a console, right? So why not try the backspace? Have you tried ctrl-h (0x08)?

-Joe

If what Joe said doesn't work, you could try \010, a backup for \b.

jhersh 29-03-2010 01:56

Re: Virtual Console Backspace Character?
 
Quote:

Originally Posted by Robby Unruh (Post 944396)
If what Joe said doesn't work, you could try \010, a backup for \b.

Last I checked, 010 == 0x08 == 8. Welcome to the world of octal... aka base-8 numbers.


All times are GMT -5. The time now is 09:43.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi