[fpc-pascal] Can We use CRT and Video Unit in Single Unit In free pascal

Tomas Hajny XHajT03 at hajny.biz
Mon Jun 23 14:31:33 CEST 2014

On Mon, June 23, 2014 12:09, mokashe.ram wrote:


>      Thanks for your help.
>       I have Gone throgh the previous post,
>      (In)compatibility of units Video and Crt is platform
>      specific thing. They can be used together without any issues on
> platforms
>      providing sufficient access to the console.
>        *it means i cann't use write/Writeln function using video unit*
> i just want to check at particular screen location value exist or not using
> Videobuf ( ex. If VideoBuf[Offset <> ' ' Then Begin ...End]) . i can
> but i cannt use any crt function with VideoBuf.

Indeed, you should not mix access to the console using Crt.Write(Ln) with
access via Video.VideoBuf^. On the other hand, you can use Video.VideoBuf^
together with keyboard related functions from unit Crt (with the caveat
that it would work on e.g. Win32 but not e.g. on Linux).

Vice versa, you may be able to use functionality provided by unit Video
for changing the console resolution (under Win32) together with
Crt.Write(Ln) as long as you re-initialize the window coordinates
(Crt.Window) after Video.SetVideoMode and before any Crt.Write(Ln).


More information about the fpc-pascal mailing list