10 DIM Shopping, Days
20 GOSUB 200
30 GOTO 32767
200 SET Shopping="27"
300 FOR Days = 1 to 27
400 Shopping=Days - 1
500 NEXT Days
600 RETURN
700 GOTO 32767
32767 END
« Happy Thanksgiving! | Main | Back in the Day »
10 DIM Shopping, Days
20 GOSUB 200
30 GOTO 32767
200 SET Shopping="27"
300 FOR Days = 1 to 27
400 Shopping=Days - 1
500 NEXT Days
600 RETURN
700 GOTO 32767
32767 END
This page contains a single entry from the blog posted on November 28, 2003 3:42 PM.
The previous post in this blog was Happy Thanksgiving!.
The next post in this blog is Back in the Day.
Many more can be found on the main index page or by looking through the archives.
Comments (3)
Not sure if line 700 "GOTO 32767" is required.... I would have thoughtt that the 600 "RETURN" should have takne control back to line 30 "GOTO 32767"...
Posted by Peter Thomas | November 30, 2003 3:02 AM
Posted on November 30, 2003 03:02
I think line 200 is not needed either unless that version of BASIc cannot jump to a condition.
Ps, don't just remove the line without chaning the gosub on line-20. A common mistake.
Posted by sjon | December 1, 2003 1:44 AM
Posted on December 1, 2003 01:44
Yup, line 200 would meet the condition of the for/next loop. Hence, the loop would not run and program execution would end.
And, as you said, since line 200 is referenced by the GOSUB, you have to have something there. In this case, a REM statement would work.
Posted by DanS | December 1, 2003 8:04 AM
Posted on December 1, 2003 08:04