QB64 Phoenix Edition
If Print - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: If Print (/showthread.php?tid=1518)

Pages: 1 2


If Print - Dimster - 03-03-2023

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.


RE: If Print - TerryRitchie - 03-03-2023

(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.


RE: If Print - vince - 03-03-2023

why not now? great idea for a new PE feature


RE: If Print - Petr - 03-03-2023

So I'm also too lazy write THEN... (but then one might ask - why are you getting into Basic?)

Smile


RE: If Print - CharlieJV - 03-03-2023

(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_dartmouthB_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.


RE: If Print - James D Jarvis - 03-03-2023

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" ?


RE: If Print - TerryRitchie - 03-03-2023

(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.


RE: If Print - SMcNeill - 03-04-2023

(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.


RE: If Print - James D Jarvis - 03-04-2023

(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.


RE: If Print - SMcNeill - 03-04-2023

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