Can We use CRT and Video Unit in Single Unit In free pascal

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Can We use CRT and Video Unit in Single Unit In free pascal

mokashe.ram
HI,
          Can We use CRT and Video Unit in Single Unit Simulteneously...

Thanks
SUD
Reply | Threaded
Open this post in threaded view
|

Re: Can We use CRT and Video Unit in Single Unit In free pascal

Jonas Maebe-2

On 23 Jun 2014, at 09:45, mokashe.ram wrote:

>          Can We use CRT and Video Unit in Single Unit Simulteneously...

That is documented: http://www.freepascal.org/docs-html/rtl/video/ (the remark at the bottom of the page)


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Can We use CRT and Video Unit in Single Unit In free pascal

Tomas Hajny-2
On Mon, June 23, 2014 09:51, Jonas Maebe wrote:
> On 23 Jun 2014, at 09:45, mokashe.ram wrote:
>
>>          Can We use CRT and Video Unit in Single Unit Simulteneously...
>
> That is documented: http://www.freepascal.org/docs-html/rtl/video/ (the
> remark at the bottom of the page)

While Jonas is correct that this combination is neither recommended nor
officially supported (among others due to the fact that this combination
would not work on some of FPC supported platforms), it _does_ work for
some other platforms as already mentioned on this list in another thread
also started by you (see
http://lists.freepascal.org/pipermail/fpc-pascal/2014-May/041991.html).

Tomas


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Can We use CRT and Video Unit in Single Unit In free pascal

mokashe.ram
Hi
     Thanks for your help.
      I have Gone throgh the previous post,

     (In)compatibility of units Video and Crt is platform (implementation)
     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 check but i cannt use any crt function with VideoBuf.

Please correct me

Thanks
SUD



     
Reply | Threaded
Open this post in threaded view
|

Re: Can We use CRT and Video Unit in Single Unit In free pascal

Tomas Hajny-2
In reply to this post by mokashe.ram
On Mon, June 23, 2014 12:09, mokashe.ram wrote:


Hi,

>      Thanks for your help.
>       I have Gone throgh the previous post,
>      (In)compatibility of units Video and Crt is platform
(implementation)
>      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
check
> 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).

Tomas


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Can We use CRT and Video Unit in Single Unit In free pascal

DaWorm
Or you can do the right thing and not use the contents of the video memory as if it were a variable to be used to check if you have or have not done a particular thing, which is what it looks like your original code does.  

This would require understanding more of what the program you are porting was intended to do and less of how it did it.  Once you have that, so many questions answer themselves.

Jeff.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Can We use CRT and Video Unit in Single Unit In free pascal

mokashe.ram
In reply to this post by Tomas Hajny-2
Ok Thanks  , Tomas
Reply | Threaded
Open this post in threaded view
|

Re: Can We use CRT and Video Unit in Single Unit In free pascal

mokashe.ram
In reply to this post by DaWorm
Thanks Jeff