Log in

View Full Version : Bug report.



Dilan Rona
23-06-2019, 10:29 PM
Found a problem with freepascal and lua when using the crt unit. Issue occurs when creating a pascal library called from lua, or when loading a lua script through a pascal program.

When the crt unit is loaded, the program stops responding when using io.read(), or io.input():read(...). Also when using the print function, the output is not lined up properly as expected. Issue only appears when I load the crt unit.

Anyone else having this problem, and is there a workaround that does not involve dropping the crt unit?

de_jean_7777
24-06-2019, 09:13 AM
Anyone else having this problem, and is there a workaround that does not involve dropping the crt unit?

Afaik, the crt unit does something funky with stdin and stdout, so I usually avoid it. Can't say I know of an alternative. What functionality do you need crt for exactly?

Dilan Rona
26-06-2019, 06:45 PM
michael from freepascal.org gave the following reply.





> This is normal.
> The crt unit completely disables regular input.
> There is nothing we can do about this, that is why the crt unit is made.






So from what I understand it interferes with the input/output handling of lua. Not just when reading input from a keyboard, but the output to the screen with print as well. and I havent tested it yet but I assume the same will hold for the file io routines as well.

I wanted to use the functions and procedures within the crt unit as lua cannot provide them (gotoxy, clrscr, window, etc...). But looks like i will have to code my own version with the needed functions and procedures.

davido
05-07-2019, 11:59 AM
I'm having the same issue since a week now and I reported it but it's still not working and I still have no answer.

Appvalley (https://getappvalley.com/) TutuApp (https://tutuappx.com/) Tweakbox (https://tweakbox.mobi/)