Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why isn't the print function working in Qbasic? What restrictions are there in the compiler?


You might be hitting the fact that QBasic actually requires keywords to be in capitals. The original IDE did the conversion for you, but repl.it doesn't. We should really be more lenient about those. For now, check the existing examples and use your trusty caps lock.


The actual QuickBASIC compiler allowed any case for keywords.

The lack of line numbers was a bit confusing too - my first inclination when seeing a BASIC prompt is to type

  10 PRINT "hello"
  20 GOTO 10
Aside from that, it seems to work as expected (at least in the quick tests I tried).


Numeric labels also don't work:

  10: PRINT "hello"
  GOTO 10
This works though:

  label: PRINT "hello"
  GOTO label




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: