If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!
8 posts • Page 1 of 1
Mac you both used END instead of SYSTEM too. Bad boys LOL
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Good catch, but I had a reason: focus on how to capture key, not how to terminate a program.burger2227 wrote:Mac you both used END instead of SYSTEM too. Bad boys LOL
Shows that programs that are to be compiled need to end with some kind of final prompt so the program doesn't leave before you see final results.
Code: Select all
CLS PRINT "Press ESC to exit program, 'T' to print time" DO PRINT : PRINT "Press key: "; DO: k$ = INKEY$: LOOP WHILE k$ = "" IF k$ = CHR$(27) THEN EXIT DO ELSE PRINT k$ IF UCASE$(k$) = "T" THEN PRINT TIME$ LOOP PRINT : PRINT LINE INPUT "Press ENTER"; e$ SYSTEM
Also shows that ESC is a good way out rather than bogus Q.