[pm-h] VT100

Julian Brown julian at jlbprof.com
Fri Dec 11 06:20:44 PST 2015


Trace (I hope I spelled it correctly)

Last night you asked me what my trick was, that I used discussing my Forex
code, that controlled the placement of text on the screen.

Google VT100 escape sequences:

In that program I used 2 VT100 tricks and strictly formatted strings using
printf.

Here is one:

# clear screen
# vt100 clear screen ESC[2J
print chr(27) . '[2J';

Another

# goto top of window
# vt100 cursor home ESC[H
print chr(27) . '[H';

Attached is the perl code involved.   Hope this helps.

There are some escape sequences where you can place the cursor before
printing text.  I did not use that sequence.

Investigate from metacpan.org, Curses and related modules.   Curses is a
layer of code that sits on top of the escape sequences your terminal
supports and gives you precise placement of text.

Julian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/houston/attachments/20151211/edb68dc3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: program_001.pl
Type: text/x-perl-script
Size: 2980 bytes
Desc: not available
URL: <http://mail.pm.org/pipermail/houston/attachments/20151211/edb68dc3/attachment.bin>


More information about the Houston mailing list