6

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.

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
MD XF
  • 7,860
  • 7
  • 40
  • 71

1 Answers1

16

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

Aurélien Gasser
  • 3,043
  • 1
  • 20
  • 25
  • Yes, that is correct and I gave you credit for that. However, it doesn't work in Business Basic. Please see this URL: :http://documentation.basis.com/BASISHelp/WebHelp/commands2/print_verb.htm – amit kohan Apr 16 '18 at 21:52
  • Just found out that in Business Basic instead of using a semicolon (;) we have to use a comma (,) – amit kohan Apr 16 '18 at 22:41