Main Menu
PBP Code Menu
Login
Username:

Password:


Lost Password?

Register now!
Other: ANSI Codes for HyperTerminal  
Author: Darrel Taylor
Published: 4/29/2004
Read 5616 times
Size 3.18 KB
Printer Friendly Page Tell a Friend
 
ANSI codes

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.

Colors
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.

 
Downloads for Other: ANSI Codes for HyperTerminal
ansi.inc
downloads File Description:
Include file for Picbasic Pro , use with HyperTerminal

downloads 979  File Size 3.62 KB  File MimetypeunknownUploaded: 5/16/2004
Article Rated: 8.33 (3 votes)
Rate this Article
Return to Category | Return To Main Index
The comments are owned by the poster. We aren't responsible for their content.
Poster Thread