Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Over-write previously printed line

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
pjc30943



Joined: 02 Dec 2005
Posts: 220

Posted: 15 September 2009, 23:24 PM    Post subject: Over-write previously printed line Reply with quote

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 Reply with quote

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: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group