Question

Traditionally BASIC offers the question mark (?) character as an abbreviation for the PRINT command.
I did not find this feature in the BASIC standard ECMA-116.
Does anyone know when or why it was introduced in the past?
Should a modern day BASIC still support it?

Was it helpful?

Solution

Question mark abbreviation seems not to be part of any official standard, but I've read somewhere that BASIC language generally was hard to standarize as everyone was interested in keeping in "freestyle" and non-constrained.

Now, to answer your questions:

When or why it was introduced in the past?

The oldest trace of using question mark abbreviation that I've found is in PET-CBM Personal Computer Guide by Donahue and Eager, 1980. I suspect that someone with enough time could try to find earlier sources.

I don't know why this abbreviation was introduced, but I guess it was for reducing errors while mistyping PRINT. I've found such reasoning for abbrievations in old book about Fortran - the less you type, the less you make mistakes (also: you're faster and more concise). This is also why even in modern programming languages there is a custom of naming index variables with one letter names. Also, some interpreters of Basic employed other abbreviations for PRINT: P, PR, P., PR., PRI. (and even PRIN. was possible in Palo Alto Tiny BASIC alhtough it has no sense). Some interpreters had shortcuts for majority of commands.

Should a modern day BASIC still support it?

It's up to you. I would allow it as this not a big trouble and it seems from all possible shortcuts and abbrievations invented through the years this one seems to be the most popular and is generally accepted. Also, I've seen ? being used in one quite modern Visual Basic .NET book on Google Books.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top