Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If Print
#11
Thank you CharlieJV, that's a very interesting website.

James D Jarvis - Not sure how other programmers interpret IF A but to me it doesn't sound/feel like a conditional statement like IF A = B does. It feels more like a question of existence. The only answer to IF A is -1 or 0. Similarly Print doesn't sound/feel like a condition but a command, like GOTO feels like a command. I do get Petr's point that it appears a lazy way of avoiding THEN but IF A Print "...." to me, is more a natural Question/Command than a Condition/Condition situation.
Reply
#12
Purebasic supports no such thing as "THEN". However every "IF" had to be matched by "ENDIF" and you weren't given the choice, even if it was to execute a single statement and if it were on one line. Like so:

Code: (Select All)
If A = "foo" : PrintN(A) : EndIf

"THEN" replaced by colon for a single-line "IF" statement, on that language which to me is more like Pascal than like BASIC.

Not sure but Texas Instruments cartridge basic allowed "THEN" replaced only by "GOTO" because the conditional statement only supported branching. This might be true about other interpreted BASIC's.

@TerryRitchie you have just depressed me, I lost my Tandy1000HX a long time ago... funnest toy I've ever had which couldn't do multimedia.

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

How about "P." on TRS-80 Model I? "GOS." for "GOSUB". Cryptic error messages different from "?SN ERROR" from my Color Computer 2? LOL at "hunt-and-peck", no problem for most of the users of the British computer though.

The TRS-80 Model I must have had no more than 4KB RAM but the interpreter did a poor job trying to help the programmer conserve characters in memory to hold the program. LOL just one character off "GOSUB" for its abbreviation? Anyway it's what I read about; I didn't have a computer older than a TRS-80 Model III that somebody abandoned. :/
Reply
#13
(03-04-2023, 02:47 PM)mnrvovrfc Wrote: @TerryRitchie you have just depressed me, I lost my Tandy1000HX a long time ago... funnest toy I've ever had which couldn't do multimedia.

I actually have a couple Tandy 1000HX systems as well as a 1000EX. I have a few SX and TX systems, one or two TL systems and the last Tandy branded 486 sold by Radio Shack.

If you're interested I could sell you one of my 1000HXs for a fair price. I've been thinking of thinning the herd lately any way. I upgraded all my 1000HX systems to 640K, 2GB hard drive (XTIDE CF card), dual COM port, 2nd LPT2 port (so you can use a backpack external parallel drive if you wish). I don't use CGA monitors on my systems but instead use VGA LCD monitors and this adapter:

https://monotech.fwscart.com/EternalCRT_...78791.aspx

The CF hard drive has at least 125 games pre-installed and lots and lots of software and programming languages as well all accessed through an easy to use menu.

If you're interested let me know.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#14
(03-04-2023, 01:50 PM)Dimster Wrote: James D Jarvis - Not sure how other programmers interpret IF A but to me it doesn't sound/feel like a conditional statement like IF A = B does. It feels more like a question of existence. The only answer to IF A is -1 or 0. Similarly Print doesn't sound/feel like a condition but a command, like GOTO feels like a command. I do get Petr's point that it appears a lazy way of avoiding THEN but IF A Print "...." to me, is more a natural Question/Command than a Condition/Condition situation.

Every evaluation of IF is reducing it to -1 or 0 .   If A is also the same as IF A <>0 . I suppose it's "If  A has a value that isn't 0" or "If true then..."


Code: (Select All)
A= 100  
If A then print "Not Zero"
if A<>0 then print "Also Not Zero"
Reply




Users browsing this thread: 2 Guest(s)