|
|
| Author |
Message |
pjc30943
Joined: 02 Dec 2005
Posts: 220
|
|
Posted: 15 September 2009, 23:24 PM Post subject: Over-write previously printed line |
|
|
Is there a terminal command supported in zbasic to print pending characters at the start of the current line? I.e., displaying a changing number in place without entering to a new line for each update.
I know this is not supported by debug.print, but are there any COM1 tricks? |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 15 September 2009, 23:54 PM Post subject: Re: Over-write previously printed line |
|
|
| pjc30943 wrote: | | Is there a terminal command supported in zbasic to print pending characters at the start of the current line? | It all depends on what "terminal" you're using to view the output. Some terminal programs will move the cursor to the beginning of the line when they receive a carriage return (&H0d) and move to the next line when they receive a line feed (&H0a). The ZBasic IDE, however, does not do this. Rather, it treats a carriage return as an end-of-line character just as it does a linefeed. A linefeed immediately following a carriage return is ignored so the net effect is that CR, LF and CR-LF are all equivalent. |
|
| Back to top |
|
 |
Don_Kirby
Joined: 15 Oct 2006
Posts: 329
Location: Long Island, New York
|
|
Posted: 16 September 2009, 0:49 AM Post subject: |
|
|
I've done quite a bit of work using Hyperterminal and ZBasic. Most terminal emulation software (hyperterminal included) is actually emulating a DEC VT100/VT220 terminal. As such, you are welcome to use any number of escape codes to manipulate the screen/cursor/text.
In effect, you need only change your method of control. If the processor cannot output the correct formatting, then use the receiving end's abilities to achieve the same effect. I've used this method for menu driven applications written in ZBasic with excellent results. It's simply a matter of defining a few constants that contain the appropriate escape codes and embedding them in the debug.print statements.
Unrelated to your actual question, but worth mentioning here; be cautious when using debug.print in application code. There's a reason why it starts with 'debug'. A better method would be to open a com channel and write directly to the channel's output queue.
-Don Kirby |
|
| Back to top |
|
 |
|