Using Windows HyperTerminal with Prop
· Using the BS2 object I was able to DEBUG to the Windows Hypertext Terminal.· This is a very basic question: how do I clear the window of previously printed text?· I have no experience with Hypertext and could not find any info in the help menu.· I also am not able to advance the cursor to the next row.· The CR function places the cursor back in the HOME position.· Thank you.
Post Edited (Mikerocontroller) : 1/25/2010 7:42:30 AM GMT
Post Edited (Mikerocontroller) : 1/25/2010 7:42:30 AM GMT

Comments
$0D or carriage return normally only ever returns to the left of the "carriage" or the same line. $0a is the line feed and so the correct new line sequence should always be $0d $0a.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
carriage return moves the cursor to the home position.
line feed moves it down one line
Anyway the standard way is you send both - carriage return then line feed.
I use hyperterminal and teraterm. I just tested the following and it works on both:
To clear the screen send ascii 27 then "[noparse][[/noparse]2J"
To move the cursor to the top left, ascii 27 then "[noparse][[/noparse]H"
These are standard VT100 codes. There are other codes to move the cursor round on the screen, delete lines etc.
I wrote a tiny program in CP/M Sbasic on the Dracblade to test the above. It works on both hyperterminal and teraterm:
You can write this in any language you like - but spin would be the simple choice. Some kind soul may be able to rewrite the above in Spin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
'********************************* ANSI TERMINAL SUPPORT ****************** con black = 0 red = 1 green = 2 yellow = 3 blue = 4 magenta = 5 cyan = 6 white = 7 pub vtx(ch) tx(ch) pub spaces(n) repeat n vtx(" ") pub tab vtx(9) pub atr(ch) escb(ch) vtx("m") pub plain ' disable attributes atr($30) pub reverse ' reverse text atr($37) pub bold atr($31) pub esc(ch) vtx($1b) vtx(ch) pub escb(ch) esc($5b) vtx(ch) pub curoff escb("?") dec(25) vtx("l") pub esch(ch) esc($23) vtx(ch) pub dht esch("3") pub dhb ' double height bottom - forms the bottom half of a double height character esch("4") pub narrow esch("5") pub wide esch("6") pub cur(n,cmd) esc($5b) dec(n) vtx(cmd) pub xy(x,y) ' position the cursor esc($5b) dec(y) vtx(";") dec(x) vtx("H") pub home escb($48) pub erscn ' erase the screen from the point on escb("2") vtx("J") pub erline escb("2") vtx("K") pub cls ' return home and clear the whole screen home erscn pub fg(col) ' set foreground color escb($33) vtx(col+$30) vtx($6D) pub bg(col) ' set background color escb($34) vtx(col+$30) vtx($6D) pub margins(top,bottom) esc($5b) dec(top) vtx(";") dec(bottom) vtx("r") pub horz(n)| i repeat i from 0 to n vtx($c4) pub hline(x,y,n) xy(x,y) horz(n) pub vert(n) | i repeat i from 1 to n str(string($b3,$0a,$08)) pub vline(x,y,n) xy(x,y) vert(n) pub box (x,y,w,h) ' you guessed it, draw a box or rectangle at x,y for width and height ' top line xy(x,y) ' to top left vtx($da) ' top left corner horz(w-2) ' top line vtx($bf) ' top right corner ' bottom line xy(x,y+h) ' to bottom left vtx($c0) ' bottom left corner horz(w-2) ' bottom line ' left side xy(x,y+1) ' to left side below corner vert(h-1) ' left side ' right side xy(x+w,y+1) vert(h-1) vtx($d9) ' bottom right cornetP.S. just added some comments to the code
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Post Edited (Peter Jakacki) : 1/25/2010 12:28:05 PM GMT