Wednesday 16 November 2011

What is the ANSI driver? in C programming

What is the ANSI driver?

Each computer has its own way of handling the screen. This is a necessary evil; if we became locked into a certain standard, the industry would stagnate. However, this difference causes great problems when you are attempting to write programs for different computers, as well as programs that must communicate over the phone line. To help alleviate this problem, the ANSI standard was introduced.

The ANSI standard attempts to lay a basic outline of how programs can cause the video terminal to perform certain standard tasks, such as printing text in different colors, moving the cursor, and clearing the screen. It does this by defining special character sequences that, when sent to the screen, affect it in specified ways. 

Now, when you print these character sequences to the screen normally on some computers, you see the characters themselves, not the effect they were intended to produce. To fix this problem, you need to load a program that will observe every character being printed to the screen, remove any special characters from

the screen (so that they do not get printed), and carry out the desired action. On MS-DOS machines, this program is called ANSI.SYS, and it must be loaded when the machine is booted
up. This can be done by adding the line

DRIVER=ANSI.SYS

to your CONFIG.SYS file. The actual ANSI.SYS driver might be somewhere else in your directory tree; if so, it must be specified explicitly (with the full path). Here’s an example:

driver=c:\sys\dos\ansi.sys

Cross Reference:

None.

No comments:

Post a Comment