Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If Print
#1
Was there a time in Basic when IF was simply followed by a Print statement? Seems to me I did see some code like :

If A Print "...." but the wiki indicates the only time an IF condition is not followed by THEN is the use of GOTO.
Reply
#2
(03-03-2023, 06:33 PM)Dimster Wrote: Was there a time in Basic when IF was simply followed by a Print statement? Seems to me I did see some code like :

If A Print "...." but the wiki indicates the only time an IF condition is not followed by THEN is the use of GOTO.

I just fired up my 386DX40 and Tandy 1000 HX and tried it with both GWBasic and Tandy Basic 2.02. Neither would accept that type of statement. Had to include THEN.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#3
why not now? great idea for a new PE feature
Reply
#4
So I'm also too lazy write THEN... (but then one might ask - why are you getting into Basic?)

Smile


Reply
#5
(03-03-2023, 06:33 PM)Dimster Wrote: Was there a time in Basic when IF was simply followed by a Print statement? Seems to me I did see some code like :

If A Print "...." but the wiki indicates the only time an IF condition is not followed by THEN is the use of GOTO.

If you sneak a peek at https://archive.org/details/bitsavers_da...hB_3679804, you'll see that the grand-pappy of them all had the options:

IF condition THEN statement
IF condition GOTO line

I've also seen:
IF condition THEN line

But who knows what other possibilities have existed among all of the BASIC dialects.
Reply
#6
I recall a version of BASIC that was once just : 

IF condition <line number> 

Because the only thing IF was used for was branching but the utility of IF condition Print  just seems unnecessary because IF condition THEN <almost any other code> works fine.



okay not completely related but does anyone recall why "?" was used as a shorthand for print?  It seems like a great shorthand for Input but baffling for print.  Is it just because "?" look a little like "P" ?
Reply
#7
(03-03-2023, 08:15 PM)James D Jarvis Wrote: Okay not completely related but does anyone recall why "?" was used as a shorthand for print?  It seems like a great shorthand for Input but baffling for print.  Is it just because "?" look a little like "P" ?

I believe HP had a version of BASIC that used this (no idea why ? was chosen though) therefore Woz and Gates used it in their ROM implementations since HP's version was used on BASIC time-share systems back in the late 60s/early 70s.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#8
(03-03-2023, 08:15 PM)James D Jarvis Wrote: okay not completely related but does anyone recall why "?" was used as a shorthand for print?  It seems like a great shorthand for Input but baffling for print.  Is it just because "?" look a little like "P" ?

Location on a standardized keyboard would be my guess.  If you wanted some symbol for shorthand for PRINT, wouldn't you want it close to the same keyboard location for the quote symbol?   

SHIFT-/ SHIFT-' SHIFT-'...  
?"" 

They're all right there together and quick and easy to type with one hand.  I'd think positioning had as much to do with the key chosen, as anything.
Reply
#9
(03-04-2023, 12:06 AM)SMcNeill Wrote:
(03-03-2023, 08:15 PM)James D Jarvis Wrote: okay not completely related but does anyone recall why "?" was used as a shorthand for print?  It seems like a great shorthand for Input but baffling for print.  Is it just because "?" look a little like "P" ?

Location on a standardized keyboard would be my guess.  If you wanted some symbol for shorthand for PRINT, wouldn't you want it close to the same keyboard location for the quote symbol?   

SHIFT-/ SHIFT-' SHIFT-'...  
?"" 

They're all right there together and quick and easy to type with one hand.  I'd think positioning had as much to do with the key chosen, as anything.

I never considered that being a two-handed typer. My first computer was also a TI-99/4a ... now there's an annoying keyborad for you.
Reply
#10
Got to remember, we're talking in the beginning of computing...  Those guys didn't have any clue about how to type, so I imagine a lot of the first programmers were "hunt-and-peck" typists.  Having the keys right close together like that probably helped them find and make use of them more efficiently.  Of all the symbols that could've been chosen for PRINT, I truly imagine the proximity of the question mark to the quotation key was a large part in why it was chosen for a shortcut.  Smile
Reply




Users browsing this thread: 7 Guest(s)