rewritng function

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

rewritng function

mokashe.ram
Hi eveyone,

     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;

Reply | Threaded
Open this post in threaded view
|

Re: rewritng function

Jonas Maebe-2

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.


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: rewritng function

Tomas Hajny-2
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


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal