Скачать ANSI Alternate to CRT unit

Rick Housh
28.05.1988
Скачать файл (12,48 Кб)

The variable TextAttr is maintained, although not used. Just for the curious. It serves no purpose. The variable CheckBreak is supported. None of the other variables are supported, as almost all have to do with various aspects of direct screen writing, which is not supported.

None of the Crt Mode constants are supplied. All of the Text Color constants are supported.

It is possible to do much more with ANSI actually, than with many of Turbo's standard CRT procedures, but no extras were implemented, in the interest of compatibility with Turbo.

There is one major limitation. The window procedure is not supported. In the interest of universal compatibility Textmode is also not supported, although it could be.

The following CRT unit functions and procedures are supported as follows:

AssignCrt : Not supported ClrEol : Fully supported ClrScr : Fully supported Delay : Not supported DelLine : Not supported (Could easily be, but never used it) GotoXY : Fully supported HighVideo : Fully supported InsLine : Not Supported (See DelLine) LowVideo : Fully supported NoSound : Not supported Sound : Not supported TextBackground : Fully supported TextColor : Fully supported TextMode : Not supported Window : Not supported KeyPressed : Fully supported NormVideo : Fully supported ReadKey : Fully supported WhereX : Fully supported WhereY : Fully supported

Those miscellaneous functions which are not supported are almost all available in Carley Phillip's CRTI unit, available in this DL as CRTI.ARC. Combine some of these and some of those in one unit if you need the Sound, NoSound, Delay, etc. If you do this however, you will lose some of the MS-DOS generic nature of these routines, which depend only on DOS and ANSI, and require no IBM compatibility. Under NO circumstances may this unit be used in combination with the standard CRT unit. It is a replacement. The Graph, Graph3 and Turbo3 units are not compatible with this unit and should not be used either.

This unit supplies one unit not available in CRT, the GetKey function. Most of the time I just want a character returned. I am not interested in function keys, etc. GetKey does just that. It first flushes the keyboard, in case you accidentally pressed something, ignores function keys, and returns the value of the keypress as a character. Where the variable ch is a character, the appropriate syntax would be:

ch := GetKey;

It will then wait for the key.