1970's DGC [0] BASIC hat on.
moonshadow wrote:10 IF MAN IN SKIRT = SCARED TO LEAVE THROUGH THE FRONT DOOR THEN GOTO 20
ERROR 02 - SYNTAX
20 GO OUT THE BACK JACK
ERROR 02 - SYNTAX
Strict BASIC hat off, but CS hat on.
One needs to be careful with code quotes, even with pseudo-code. I say this because sooner or later some poor sod is going to try pasting it into something and is then going to freak out when it doesn't work because they believe that everything on the Internet is true. (The poor bastards.)
In proper BASIC, that program would occupy several lines depending on the precise intent [3] of the snippet above. Real BASIC allows one comparison per statement (i.e. no AND/OR conjunctions) and the single GOTO [2] [f].
[0] Data General Corporation, b 1968, d 1999 "Last [1] of the Minicomputer Giants of Massachusetts. RIP"
[1] The pundits all held that DG would be the first to fall. History proved them all wrong; DG was the last to fail. DEC (Digital Equipment Corporation) failed first, then a slew of others, and finally DG fell when it was bought out by EMC in '99.
[2] NOT "
Harmful" as all computer code eventually compiles into conditional branches for things. A computer without a jump [a]/branch/goto instruction isn't Turing complete.
[3] which is syntactically unclear
[a] JUMP in the (DEC) PDP-6/PDP-10 is a no-op. The instruction-set is orthogonal -- to make the machine jump to a new address required a "JUMPA" [d] instruction. Hackers
quickly realised that JUMPA took several more cycles to execute than a "JRST 0" [e] and used the latter. This persisted until the architecture died in the 1980s.
Real ones, mind, not the modern types. Real ones designed an implemented new instructions on machines if the hardware wasn't capable.
[c] JRST's counterpart was JFCL (Jump on Flags and CLear); JFCL remains the canonical no-op to those "above a certain age".
[d] JUMP Always
[e] Jump and ReSTore flags [c]. With the zero specified, no flags were changed and execution proceeded at the address specified in the instruction.
[f] A statement of 'GOTO "Hell"' is valid in some dialects of BASIC -- so long as it's a defined label -- but not many. It's an utter failure in FORTRAN.