ANSI Codes for Hyper Terminal

DT 4-29-2004

Download and unzip the include file from here:
ANSI codes (for Picbasic Pro)

Does your output to HyperTerminal look rather boring. Black text on a white background and continuously scrolling off the screen, many times before you even get a chance to read it. Maybe this will help.

This is an include file that will allow you to change text and background colors, clear the screen, move the cursor, and several other functions. It can greatly improve the appearance of your programs output. It is written for use with a USART and Hserout commands. It does not work with Serout or Serout2.

Colours
black
red
green
yellow
blue
magenta
cyan
white
ForegroundLightDark
dark
light

Commands:
TermColor ForegroundLightDark, ForegroundColor, BackgroundColor
ForColor ForegroundColor
BackColor BackgroundColor
Normal
Bold
Dim
Italic
UnderScore
Blink
Negative
CurUp
CurDown
CurRight
CurLeft
CurHome
CurMove Row, Col
ClearScr
ClearLine
ClearUp
ClearDown
RequestCurPos

Each command is implemented as a macro, so unless you actually use that command in your program it doesn't use up any code space. Each instance of the command will use some space, dependant on the command, and where it is located in the program. By using the built in library of "Picbasic Pro" it utilizes the same bank and page switching techniques used by PBP itself. Making it pretty worry free as far as programming goes.

To use the commands, just include the ansi.inc file in your main program like this

INCLUDE "ANSI.INC"

Then start each line with an @ symbol, followed by the command name and parameters if needed.
@ ForColor yellow ; Set foreground (text) color to yellow

@ BackColor blue ; Set background color to blue

@ Blink ; Blinking text

@ ClearScr ; Clear Screen

If you're using MPASM all command names and colors are case sensitive. For PM they are not.


Download and unzip the include file from here:
ANSI codes (for Picbasic Pro)

Page last modified on March 04, 2018, at 02:54 PM