I have been using PureBasic to run Engineering algorithms that have the inputs specified in the Programs. The output comes up on the Debug Screen OK.
Tried to use the input and print functions to display on the Console. But, no luck. Programs execute to end ok but do not show inputs or outputs.
Even the following simple program from the Help Section will not work.
If OpenConsole()
Print (" Press enter to exit")
Input ()
CloseConsole ()
EndIf
End
Any suggestions would be appreciated.
Brian W
Print Function when using Console
Re: Print Function when using Console
Hello,
What is your version of PureBasic?
What OS are you working on?
Could you test with an error handler?
This is an example :
Procedure ErrorHandler()
MessageRequester("Test OnError", "Error: " + ErrorMessage())
; or
;Debug ("Error: " + ErrorMessage())
EndProcedure
OnErrorCall(@ErrorHandler())
If OpenConsole()
Print (" Press enter to exit")
Input ()
CloseConsole ()
EndIf
End
Best regards. BeePee
What is your version of PureBasic?
What OS are you working on?
Could you test with an error handler?
This is an example :
Procedure ErrorHandler()
MessageRequester("Test OnError", "Error: " + ErrorMessage())
; or
;Debug ("Error: " + ErrorMessage())
EndProcedure
OnErrorCall(@ErrorHandler())
If OpenConsole()
Print (" Press enter to exit")
Input ()
CloseConsole ()
EndIf
End
Best regards. BeePee
Re: Print Function when using Console
Did you compile with the executable type set to 'Console' if you use Windows ?
Re: Print Function when using Console
Code: Select all
If OpenConsole()
Print (" Press enter to exit")
Input ()
CloseConsole ()
EndIf
regardless wich compiler is chosen or executeable-
format is set to 'console' or 'windows'.
Tested with PB 5.73 LTS, PB 6.00 LTS ASM- and
PB 6.00 LTS C backend.
All tested with in Windows x64.
Re: Print Function when using Console
If Brian W are using Linux he needs to set the executable format to 'Console' in Compiler Options.
Spec: Linux Mint 20.3 Cinnamon, i7-3770K, 16GB RAM, RTX 2070 Super
Re: Print Function when using Console
As usual thanks for help on my problem. I run a Mac Mini M1 with latest version of PureBasic for Mac OS.
In short, changing the Compiler Options from MacOS to Console solves the problem and i can now Text In and Text Out.
I found out that I need to do this everytime that I start a program as the Compiler Option reverts to Mac OS on startup.
Brian W
Australia
In short, changing the Compiler Options from MacOS to Console solves the problem and i can now Text In and Text Out.
I found out that I need to do this everytime that I start a program as the Compiler Option reverts to Mac OS on startup.
Brian W
Australia
Re: Print Function when using Console
You may change the default "MacOS" to "Console" in the Preferences:
- In the menu of the IDE click onto "PureBasic > Preferences..."
- Click onto "Compiler > Defaults"
- In the dropdown box behind "Executable format:" select "Console"
- Click onto "OK"
Re: Print Function when using Console
Normally, this information is stored in the pb file. Unless you have disabled this function in options / preferences.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive