Some languages automatically insert a newline after outputting a string, unless measures are taken to prevent its output.



Task

Display the string   Goodbye, World!   without a trailing newline.



Related tasks

   Hello world/Graphical
   Hello world/Line Printer
   Hello world/Standard error
   Hello world/Text


 
'In a window
 
DEF Win:WINDOW
DEF Close:CHAR
DEF ScreenSizeX,ScreenSizeY:INT
 
GETSCREENSIZE(ScreenSizeX,ScreenSizeY)
 
WINDOW Win,0,0,ScreenSizeX,ScreenSizeY,0,0,"Goodbye program",MainHandler
 
PRINT Win,"Goodbye, World!"
'Prints in the upper left corner of the window (position 0,0).
PRINT"Win," I ride off into the sunset."
 
'There does not appear to be a means of starting a new line when printing in a window, other than by using the MOVE command.
'Therefore, both sentences here will print on the same line, i.e., in the same vertical position.
 
WAITUNTIL Close=1
 
CLOSEWINDOW Win
 
END
 
SUB MainHandler
 
    IF @CLASS=@IDCLOSEWINDOW THEN Close=1   
 
RETURN
 
'In the console
 
OPENCONSOLE
 
'Insert a trailing comma.
PRINT"Goodbye, World!",
PRINT" I ride off into the sunset."
 
PRINT:PRINT"Press any key to end."
 
DO:UNTIL INKEY$<>""
 
CLOSECONSOLE
 
'Since this a Cbasic console program.
END 
 