printingbasicgw-basic

Print without newline


In BASIC I know of two instructions to print to the screen, PRINT, and WRITE, both of which automatically print strings with a newline at the end. I want to print a string without a newline. How can I do this? I'm using GW-BASIC.


Solution

  • Using PRINT with a semicolon will not print a new line:

    10 REM The trailing semicolon prevents a newline
    20 PRINT "Goodbye, World!";
    

    Source: Rosettacode