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:UINT
 
GETSCREENSIZE(ScreenSizeX,ScreenSizeY)
 
OPENWINDOW Win,0,0,ScreenSizeX,ScreenSizeY,NULL,NULL,"Goodbye program",&MainHandler
 
PRINT Win,"Goodbye, World!"
'Prints in upper left corner of the window (position 0,0).
PRINT Win," You won't have this program to kick around anymore."
 
'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 @MESSAGE=@IDCLOSEWINDOW THEN Close=1
 
RETURN
ENDSUB
 
'In the console
 
OPENCONSOLE
 
'by inserting a trailing comma.
PRINT"Goodbye, World!",
PRINT" You won't have this program to kick around anymore."
 
PRINT:PRINT
 
'A press any key to continue message is automatic in a program compiled as console only.
'I presume the compiler adds the code.  
CLOSECONSOLE
 
'Since this an IWBASIC console program.
END 
 