Open byronpendason opened 7 months ago
As an update, I went through your examples and discovered that in order to use if block statements, you must use BEGIN after THEN and ELSE. The following modification of the above code works:
PRINT "What is your name, adventurer?"
INPUT "> "; name$
IF name$ = "Byron" THEN BEGIN
PRINT "Welcome, Byron, greatest hero of all time!"
ELSE BEGIN
PRINT "Greetings, "; name$; ". Not the hero I was expecting, but I guess you'll do."
END IF
So, while this makes sense, it's not QBasic compatible because QBasic lacks the BEGIN statement.
My code:
I get an error about no viable alternative, as shown in the screenshot provided.