Code: Select all
OpenConsole()
Input()
End
CloseConsole()
Is this intended?
Code: Select all
OpenConsole()
Input()
End
CloseConsole()
Code: Select all
; Important Remark (borrowed from Help):
;
; On Microsoft Windows, there are two different executable formats: Win32 and Console.
; If you want to create a standard console application, like 'dir', 'del' etc. you must compile
; the executable using the 'Console' format (Compiler Option menu in the PureBasic IDE).
;
; On Linux and OS X, there is no special Console format however setting the Compiler option
; to 'Console' will launch a terminal window automatically when you run your program from the IDE.
;
Define name$
If OpenConsole() ; if result is 0, it has failed and all further call to console functions must be disabled.
Print("Please enter your name: ") ; Ask for name
name$ = Input() ; Wait for user input
PrintN("Hello " + name$)
PrintN("")
; PrintN("Press return to exit")
PrintN("Press return to close console")
Input() ; Wait for Enter/Return Key pressed by user w/o any other keys before
CloseConsole()
EndIf
; acc. to help:
;
; End .. Ends the program execution correctly.
; The 'ExitCode' optional parameter can be specified if the program need to returns an error code.
;
End ;ExitCode