Decompile to C# in SB-Prime - Checkbox Console App - Printable Version +- Small Basic Forum (https://litdev.uk/mybb) +-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1) +--- Forum: C# Moving from Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=6) +--- Thread: Decompile to C# in SB-Prime - Checkbox Console App (/showthread.php?tid=148) |
Decompile to C# in SB-Prime - Checkbox Console App - Scout - 10-15-2024 The Chess Engine SB_Scout is a mixed application with a text window and a graphics window. (PDVF923.000) As it is not a pure console application, I have disabled the checkbox "Export as Console App". Is the following error related to this or is there another cause? RE: Decompile to C# in SB-Prime - Checkbox Console App - litdev - 10-15-2024 Try exporting as a console app - this just means that it can use the TextWindow as a Console - it will also be able to use the GraphicsWindow. I did test for the C# export with a simple TW and GW case using an extension before I posted on the other thread and my very simple case did work, something like: Code: TextWindow.WriteLine("Hello World") The error message looked like it was getting null back from the TextWindow call when a key was pressed. Not quite sure how your program works, but exported C# appears to work for me when exported as Console - if I remember there was some funny use of the console to commicate with chess engine or maybe that was something different. If there are any actions I need to do with the program to make it fail, then please let me know. RE: Decompile to C# in SB-Prime - Checkbox Console App - Scout - 10-16-2024 Here are the results with single-line GW and TW programs: An error occurs if the program contains a TextWindow command and the "Export as Console" checkbox is not set. The program cannot provide a console for the text window. "Export as Console" should therefore only be disabled if you are absolutely sure that the program does not contain a text window command. If "Export as Console" is enabled, very little changes and could therefore always remain set. In the project file .csproj, the output type changes from Winexe to Exe: Code: <OutputType>Exe</OutputType> The following 3 lines are inserted in the main() function: Code: //Initialise and hide TextWindow for Console App RE: Decompile to C# in SB-Prime - Checkbox Console App - litdev - 10-17-2024 A Console app always creates a Console, that's why I added the 3 lines to create and hide a TextWindow, which derives from a Console. The default option is to make a Console app, which for SB pretty much always makes sense. Only if you were to extend the exported project under some circumstances not being a Console might be a better option. |