[fpc-pascal] rewritng function

Tomas Hajny XHajT03 at hajny.biz
Mon Jun 23 10:37:09 CEST 2014


On Mon, June 23, 2014 09:53, Jonas Maebe wrote:
> On 23 Jun 2014, at 09:01, mokashe.ram wrote:
>
>>     please help me on rewriting below fixing using any other
>> workaround..as
>> i have already gone through my post but still i am not able to fix this
>> MEM
>> issue.....this is on ly one issue which i amnot able to fix yet.....
>>
>> FUNCTION error_message_already_written : BOOLEAN;
>>
>> BEGIN
>>
>>   *error_message_already_written:=MEM[$b800:3681]
>>
>> =message_background_colour*16+error_message_colour; *END;
>
> You cannot just change this one single statement to use the video unit
> without changing the rest of the program. Well, you can, but it won't do
> anything. The video unit does not automamagically know what has been
> written to the screen in other code.
>
> Consider rewriting the logic of this code (keep track via a variable
> whether the error message has already been written) instead of trying to
> literally translate this hack.

Well, the hack may be reproducible _if_ the output to that place (1,23)
was performed using unit Video. However, I suspect that it wasn't done
that way (as suggested by the other question about units Video and Crt)
and then it's indeed impossible (without resorting to platform specific
solutions for reading the screen console content).

Tomas





More information about the fpc-pascal mailing list