The following program should prompt the user for input, but does not work as expected:
10 LET a = "Enter your name:"
20 INPUT a, b$
30 PRINT "Hello ", b$, "\n"
Instead the prompt is "a":
$ ./gobasic t.bas
asteve
Hello steve
The problem is that the INPUT statement assumes the first argument is a string, and prints the literal-body of that string. We should handle (string) variables too!
The following program should prompt the user for input, but does not work as expected:
Instead the prompt is "a":
The problem is that the INPUT statement assumes the first argument is a string, and prints the literal-body of that string. We should handle (string) variables too!