Problem with CONSOLE
issueid=541 28-05-2018 14:02
Junior Member
Number of reported issues by MBuckingham: 3
Problem with CONSOLE
Redirection of output does not work

There seems to be a bug in the CONSOLE module for version 1.10.4.0 The simplest way to demonstrate this is with a very simple program named ct01:-



'---Load Console Module
Uses "Console"


Console_Writeline "Hello"



If I run this with version 1.9.16.17 from a command box like this:-

C:\Temp>\thinBasic\thinBasicc.exe ct01.tbasicc

then it prints Hello as expected. If I then type:-

C:\Temp>\thinBasic\thinBasicc.exe ct01.tbasicc >thinOK.txt

the file thinOK.txt is created and contains the one line of text as expected.


With version 1.10.4.0 printing to the command line works as before. However redirecting the output to a text file simply creates an empty text file.


In my real application I'm running Thinbasic scripts from the software and capturing the output, and this is where I first saw the bug.



Thanks,
Malcolm Buckingham
Issue Details
Issue Number 541
Project thinBasic
Category Unknown
Status Fixed
Priority 5 - Medium
Affected Version 1.10.2
Fixed Version (none)
Milestone (none)
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)




31-05-2018 10:48
thinBasic author
Dear Malcolm,

have a look at this discussion: http://www.thinbasic.com/community/s...utput+redirect
Console module is not using standard output but I made a development in order to be able to redirect console output to a file.

Let me know if it works
Eros

31-05-2018 17:48
Junior Member
Eros,

Thanks for getting back me. I'm off on holiday tomorrow ( to Italy ) so I'll have a look at the discussion when I get back.

Malcolm

Quote Originally Posted by ErosOlmi
Dear Malcolm,

have a look at this discussion: http://www.thinbasic.com/community/s...utput+redirect
Console module is not using standard output but I made a development in order to be able to redirect console output to a file.

Let me know if it works
Eros

05-07-2018 10:29
Junior Member
Eros


Iíve finallymanaged to get some time to have another look at the problem Iímhaving with the redirection of output from a console mode script.Iíve read the thread you linked to and downloaded the two zipfiles and installed the updated versions of thinnbasic_console andthinbasic_file. Unfortunately they didnít solve the problem.


Reading the thread Ithink that the issue EmbeddedMan was having is quite different to myproblem. He was calling another program and wanting to stop thatprogramís output from appearing in his script.


At itís simplestthe problem I reported was with a stand alone console script. Withversions 1.9.16.17 and earlier it was possible to write a script thatcould write to the screen and could have itís output redirected toa file. This is useful when combining scripts within a batch file. Ihave utilities written in Pascal, C, Python, as well as thinBasic andall of them work in this standard way.


With version1.10.4.0 this standard behaviour is broken. Maybe there are not manypeople using thinBasic to write console utilities. But those who arewill find they can not use the latest version.


Malcolm

05-07-2018 17:10
thinBasic author
I will have a look.

31-07-2018 22:45
thinBasic author
Dear Malcolm,

sorry for this big delay.
Please downlaod thinBasic beta 1.10.5.0 from this link: https://www.thinbasic.biz/projects/t...c_1.10.5.0.zip
I think I've fixed this issue

Let me know
Thanks a lot
Eros

02-08-2018 09:41
Junior Member
Eros

I installed the new version and everything seems to be working again. Thanks very much for your help.

Malcolm


Quote Originally Posted by ErosOlmi
Dear Malcolm,

sorry for this big delay.
Please downlaod thinBasic beta 1.10.5.0 from this link: https://www.thinbasic.biz/projects/t...c_1.10.5.0.zip
I think I've fixed this issue

Let me know
Thanks a lot
Eros

+ Reply