home *** CD-ROM | disk | FTP | other *** search
- 3000 rem TUTR.02 Ver 2.0 01AUG83
- 3010 quote$ = chr$(34)
- 3020 gosub 4220
- 3030 print "Well, I'm glad you made it. I've been waiting for you so that"
- 3040 print "we could continue our lesson. So far, we have covered the"
- 3050 print "'INPUT' statement, the 'LET' statement (and its symbols), and"
- 3060 print "the 'PRINT' statement. Our sample program looks like this:"
- 3070 print
- 3080 print "10 INPUT X, Y, Z"
- 3090 print "20 LET R = SQR (X^2 + Y^2 + Z^2)"
- 3100 print "30 PRINT R"
- 3110 print "40 END"
- 3120 print
- 3130 gosub 4190
- 3140 gosub 4220
- 3150 print "We can do much more with the 'print' statement: besides printing"
- 3160 print "the value of a variable of interest (in our case, 'R') it can also"
- 3170 print "be used to type out labels. Anything in quotes following the"
- 3180 print "'PRINT' statement will be typed out literally on the screen. So, we add:"
- 3190 print
- 3200 print "30 PRINT ";quote$;"The radius vector equals"quote$";R"
- 3210 print
- 3220 gosub 4190
- 3230 gosub 4220
- 3240 print "By using statement number 30 again, we replace the earlier "
- 3250 print "statement 30. This is one way to correct a program. The phrase in"
- 3260 print "quotation marks will 'label' our value of R which follows."
- 3270 print "(Note the ; character. The ; is used as a separator.)"
- 3280 gosub 4190
- 3290 gosub 4220
- 3300 print "We can do the same kind of thing to the front of our program"
- 3310 print "to explain it to a user:"
- 3320 print
- 3330 print"9 PRINT ";quote$;"What are your values of X, Y, and Z";quote$";"
- 3340 print
- 3350 print "(The 'INPUT' statement which follows will supply the ?)"
- 3360 print "Notice the '9' statement number: this will be executed before"
- 3370 print "the 'input' statement in '10'. This demonstrates why it is so"
- 3380 print "handy to number statements in increments."
- 3390 gosub 4190
- 3400 gosub 4220
- 3410 print "Our new program now lists as follows:"
- 3420 print
- 3430 print "9 PRINT ";quote$;"What are your values of X, Y, and Z"quote$";"
- 3440 print "10 INPUT X, Y, Z"
- 3450 print "20 LET R = SQR (X^2 + Y^2 + Z^2)"
- 3460 print "30 PRINT ";quote$;"The radius vector equals";quote$";R"
- 3470 print "40 END"
- 3480 print
- 3490 gosub 4190
- 3500 gosub 4220
- 3510 print "When 'RUN' is typed, the program does this:"
- 3520 print
- 3530 print "What are your values of X, Y, and Z"
- 3540 input x, y, z
- 3550 print "The radius vector equals";sqr(x^2+y^2+z^2)
- 3560 print
- 3570 print
- 3580 print
- 3590 print
- 3600 gosub 4190
- 3610 gosub 4220
- 3620 print "Now, if you have a string of values to compute and want to"
- 3630 print "automatically repeat a portion of your program, you can to this by"
- 3640 print "using the statement:"
- 3650 print
- 3660 print "35 GOTO 9"
- 3670 print
- 3680 gosub 4190
- 3690 gosub 4220
- 3700 print "This will cause the computer to return to the beginning and"
- 3710 print "repeat as long as you have values of X, Y, and Z to type in."
- 3720 print "(Typing ctrl/c -- holding down the ctrl key and typing the"
- 3730 print " C key, then releasing both, will halt the program)"
- 3740 print
- 3750 gosub 4190
- 3760 gosub 4220
- 3770 print " A few final items and I'll turn you loose to try your own hand"
- 3780 print "at writing a program. Whenever you start a new program,"
- 3790 print "you tell the system by typing 'NEW'. This will clear any old program"
- 3800 print "from memory. The system will automatically number your statements"
- 3810 print "for you if you type 'AUTO'. Line numbers will automatically appear"
- 3820 print "after each carriage return, until you type ctrl-c"
- 3830 gosub 4190
- 3840 gosub 4220
- 3850 print "To store a program you have typed in on the disk, type:"
- 3860 print
- 3870 print "SAVE ";quote$;"FILENAME"quote$;",A"
- 3880 print
- 3890 print "Where the 'FILENAME' is any name, up to 8 letters and numbers, not already in use."
- 3900 gosub 4190
- 3910 gosub 4220
- 3920 print "You can recall it later by typing 'RUN' and calling it by the"
- 3930 print "name you assigned. (If you forget the names of your files,"
- 3940 print "type 'FILES' and the system will list the programs on the disk you are using.)"
- 3950 gosub 4190
- 3960 gosub 4220
- 3970 print " If you want to remove a program from your disk,"
- 3980 print "type the command 'KILL' followed by the name of the program you want deleted."
- 3990 print "the computer will erase the file and return with 'Ok' and be again available for use."
- 4000 print
- 4010 gosub 4190
- 4020 gosub 4220
- 4030 print "When you want to return to the operating system, i.e. get out of MBASIC."
- 4040 print "type ctrl-C until you get the 'Ok', then type 'SYSTEM' to return to CP/M."
- 4050 print
- 4060 gosub 4190
- 4070 gosub 4220
- 4080 print " You have now completed another lesson with your computer"
- 4090 print "Tutor and are ready to try a few things on your own."
- 4100 print "The best way to become comfortable with the system is to try"
- 4110 print "it on some of your own problems."
- 4120 print
- 4130 print "When you are ready for the next lesson, run 'TUTR.03'.
- 4140 print
- 4150 print "Hit any key to return to the main menu -->";
- 4160 gosub 40800
- 4170 run "MENU"
- 4180 end
- 4190 print:print "Hit any key to continue: ";
- 4200 gosub 40800
- 4210 return
- 4220 print cls$;fnposcur$(10,1)
- 4230 return