|
-
June 19th, 2002, 04:09 AM
#2
Ok well, I just thought about my tutorial and I think I short changed you so here is kinda a sequal:
Ok, first thing first, most of you are problably egar to try out changeing the colors of your monitor, the line I instructed you to add to your config.sys file was
DEVICE = ansi.sys
However on most modern PCs equiped with windows, that file is located in C:\Windows\Command so just change the path. All the line is doing is telling it to install or load the driver into memory so you can use it, and who knows, maybe it is already in memory.
Now you might be interested in knowing, not only can you change the screen color, you can also delete text, bold and underline text, move the cursor and more. I brifely introduced the color of your monitor codes but let me give you a more detailed look at what exactly you can do with this ansi driver you just loaded into memory.
Color:
As already discused the formate of the controll sequence to modify your monitor colors such as back ground and forgorund is:
ESC [#;....;#m
And the values you may use as parameters are:
Parameter: Meaning:
0 All atributes off (normal white/black)
1 Bold on
4 Underscore (IBM Monocrome only)
5 Blink on
7 Reverse video on
8 Canceled on (visible)
30 Black forground
31 Red forground
32 Green forground
33 Yellow forground
34 Blue forground
35 Magenta forground
36 Cyan forground
37 White forground
40 Black background
41 Red background
42 Green background
43 Yellow background
44 Blue background
45 Magenta background
46 Cyan background
47 White background
but we already stated that we send this controll sequence to the monitor with the use of the prompt command like so:
prompt $e[#;....;#m
As an example:
prompt $e[34m
That simply tells it to change the text color to blue (forground color)
Notice in the chart 5 is blink and 1 is bold, 4 is underline so there, you are not limited to color, but what about the Mouse?
Mouse (Cursor tricks):
The formate for the controll secuence for controlling the cursor is:
ESC [#;#H (Move to spesified position)
Example:
prompt $e[34,30H
ESC [#A (move cursor up a spesified number of positions)
Example:
prompt $e[5A
ESC [#B (move cursor down a spesified number of positions)
Example:
prompt $e[5B
ESC [#C (move cursor forward spesified number of positions)
Example:
prompt $e[10C
And finaly:
ESC [#;#F (moves cursor to position spesified)
Example:
prompt $e[4,5F
But dude, you promised I could delete text!
To clear the screen:
ESC [2J
will erase the screen and position the cursor at home hey it beats cls
Erase a line of text:
ESC [K
will erase from current cursor position to the end of the line.
Remembering of cource that ESC is replaced with $e for the prompt command.
Hey! ever feel like haveing an intelegint confersation with your printer? Remember that there are special names associated with your perhipherals, these are:
CON: (Console keyboard/screen)
AUX: or COM1: (Comunications port 1)
COM2: (Comunications port 2)
COM3: (Comunications port 3)
COM4: (Comunications port 4)
LPT1: or PRN: (paralel port 1, usualy conected to a printer)
LPT2:
LPT3:
So does that mean that if I do:
copy CON: PRN:
then I can talk directly to my printer? Ok try it out. But before you do I sugest you learn the comunications protocol the computer and the printer uses to talk.
Also CTRL+Z will terminate the comunications.
Have phun!
In snatches, they learn something of the wisdom
which is of good, and more of the mere knowledge which is of evil. But must I know what must not come, for I shale become those of knowledgedome. Peace~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|