Trailing-Edge
-
PDP-10 Archives
-
decus_20tap1_198111
-
decus/20-0024/tutr16.bas
There are 2 other files named tutr16.bas in the archive. Click here to see a list.
00001REM TUT16
00050REM COPYRIGHT 1966 FORD MOTOR COMPANY
00100PRINT"IN THE PREVIOUS SESSION,YOU WERE ASKED TO PERFORM SOME OPERATIONS"
00110PRINT"ON A TEST PROGRAM. HOPEFULLY, YOU ARE BECOMING MORE FAMILIAR"
00120PRINT"WITH THE CAPABILITIES FOR MODIFYING PROGRAMS."
00130PRINT
00140PRINT"THE EDIT RESEQUENCE COMMAND, WHICH YOU TRIED, IS EXTREMELY"
00150PRINT"USEFUL IN RENUMBERING STATEMENTS OF YOUR PROGRAM WHEN NEEDED."
00160PRINT
00170PRINT"FOR EXAMPLE, THE COMMAND 'EDIT RESEQUENCE 30,23,10' SAYS, IN EFFECT"
00180PRINT"STARTING WITH STATEMENT 23 OF THE PROGRAM I AM CURRENTLY"
00190PRINT"WORKING ON, ASSIGN TO IT THE STATEMENT NUMBER 30. FROM THAT POINT"
00200PRINT"ON, RENUMBER THE REMAINING STATEMENTS IN INCREMENTS OF 10."
00210PRINT
00220PRINT" BEFORE AFTER"
00230PRINT
00240PRINT"15 LET S=0 15 LET S=0"
00250PRINT"18 FOR I=N TO M 18 FOR I=N TO M"
00260PRINT"23 LET S=S+I 30 LET S=S+I"
00270PRINT"25 NEXT I 40 NEXT I"
00280PRINT"31 PRINT S 50 PRINT S"
00290PRINT
00300PRINT"SUPPOSE YOU PERFORM AN EDIT RESEQUENCE COMMAND. WHICH OF THE"
00310PRINT"FOLLOWING COMMANDS WOULD BE NECESSARY IF THE RESULTING PROGRAM"
00320PRINT"WERE TO BE OF ANY USE TO YOU IN THE FUTURE.";
00330PRINT
00340PRINT"(1) NEW (2) OLD (3) SAVE (4) STOP ";
00350INPUTZ
00360PRINT
00370IFZ=3THEN400
00380PRINT"NO. ";
00390GO TO 410
00400PRINT"RIGHT. ";
00410PRINT"'SAVE' WILL STORE THE NEWLY INCREMENTED PROGRAM IN YOUR LIBRARY."
00420PRINT"RESEQUENCING IS DONE ON A PROGRAM IN WORKING STORE, AND WILL"
00430PRINT"NOT BE SAVED UNLESS YOU SO COMMAND."
00440PRINT
00450PRINT"LET'S DISCUSS THE 'SAVE', 'UNSAVE', 'OLD', AND 'NEW' COMMANDS"
00460PRINT"IN MORE DETAIL."
00470PRINT
00480PRINT"'OLD' IS A COMMAND TO RETRIEVE FROM YOUR LIBRATY A PROGRAM"
00481PRINT"PREVIOUSLY SAVED, I.E. ONE FOR WHICH YOU HAVE GIVEN THE "
00482PRINT"INSTRUCTION 'SAVE'. YOU SHOULD BE ABLE TO MAKE A GOOD GUESS"
00483PRINT"AS TO THE MEANING OF 'UNSAVE' AND 'NEW'."
00520PRINT"HERE ARE 4 COMBINATIONS OF COMMANDS, PRODUCING DIFFERENT EFFECTS."
00530PRINT
00540PRINT" 1. TYPE 'UNSAVE' WHILE WORKING ON A 'NEW' PROGRAM."
00550PRINT" 2. TYPE 'SAVE' WHILE WORKING ON A 'NEW' PROGRAM."
00560PRINT" 3. TYPE 'UNSAVE' WHILE WORKING ON AN 'OLD' PROGRAM."
00570PRINT" 4. TYPE 'NEW' WHILE WORKING ON AN 'OLD' PROGRAM."
00580PRINT
00610PRINT
00620PRINT"WHICH ONE REMOVES THE PROGRAM FROM PERMANENT MEMORY (LIBRARY),"
00630PRINT"BUT LEAVES IT IN WORKING CORE. ";
00640INPUTZ
00650PRINT
00660IFZ=3THEN690
00670PRINT"NO, GUESS AGAIN (YOUR ODDS HAVE IMPROVED). ";
00680GOTO640
00690PRINT"RIGHT. WHICH ONE WOULD SEEM LIKE A MEANINGLESS OPERATION. ";
00700INPUTZ
00710IFZ=1THEN750
00730PRINT"ARE THEY ALL MEANINGLESS TO YOU? GUESS AGAIN. ";
00740GOTO700
00750PRINT"VERY GOOD. NOW, WHICH ONE COULD CONCEIVABLY REPLACE A "
00760PRINT"PREVIOUSLY SAVED PROGRAM WITH AN ALTOGETHER DIFFERENT PROGRAM. ";
00770INPUTZ
00780PRINT
00790IFZ=2THEN830
00800PRINT"NO. THIS REQUIRES AN EXPLANATION OF THE STORAGE (SAVE) PROCEDURE."
00820GOTO840
00830PRINT"SHEER GENIUS. OR A VERY LUCKY GUESS."
00840PRINT"WHEN YOU REQUEST A PROGRAM TO BE SAVED, A SEARCH IS FIRST MADE"
00850PRINT"IN YOUR LIBRARY TO SEE IF THE REQUESTED NAME IS THE SAME AS AN"
00860PRINT"EXISTING ONE. IF SO, THE NEW PROGRAM REPLACES THE OLDER ONE OF"
00870PRINT"THE SAME NAME. OTHERWISE A NEW AREA IN YOUR LIBRARY IS RESERVED"
00875PRINT"FOR THE PROGRAM TO BE SAVED. IF YOU FIND YOURSELF IN THIS"
00880PRINT"QUANDRY, YOU CAN USE THE 'RENAME' COMMAND, WHICH MAINTAINS THE"
00890PRINT"CURRENT PROGRAM IN WORKING STORE, BUT PROVIDES THE CAPABILITY"
00900PRINT"OF RENAMING IT. THUS YOU COULD THEN ASSIGN IT A UNIQUE NAME"
00910PRINT"AND STORE IT, UNTIL YOU CAN EXAMINE THE LIST OF PROGRAM NAMES"
00915PRINT"STORED IN YOUR LIBRARY, BY TYPING 'CATALOG'."
01000PRINT
01010PRINT"I DIDN'T ASK YOU A QUESTION ABOUT NUMBER 4 ABOVE - TYPING 'NEW'"
01020PRINT"WHILE WORKING ON AN 'OLD' PROGRAM. WILL THIS DESTROY A PROGRAM?"
01030PRINT"(1=YES 0=NO) ";
01040INPUTZ
01050PRINT
01060PRINT"IT WILL, BUT ONLY THE PROGRAM IN WORKING CORE AND ITS NAME. IF"
01070PRINT"YOU WANT THE CHANGES YOU MAY HAVE MADE INCORPORATED INTO THE"
01080PRINT"'OLD' PROBRAM, YOU NEED TO TYPE 'SAVE' BEFORE TYPING 'NEW'."
01090PRINT
01100PRINT
01110PRINT"THERE ARE SEVERAL OTHER SYSTEM COMMANDS WHICH WILL BE DISCUSSED"
01120PRINT"MORE FULLY IN LATER SESSIONS OF THE TUTOR SERIES. AMONG"
01130PRINT"THESE ARE THE 'EDIT'COMMANDS, USEFUL IN EDITING EXISTING"
01140PRINT"PROGRAMS. THE EDIT RESEQUENCE COMMAND DISCUSSED ABOVE IS ONE"
01150PRINT"OF THEM. AMONG THOSE WHICH ARE NOT WORD COMMANDS, BUT RATHER"
01160PRINT"KEY DEPRESSIONS, ARE THE 'CONTROL U' KEY, AND THE RUB-OUT, BOTH"
01210 PRINT"ON THE KEYBOARD. PERHAPS YOU HAVE USED ONE OR BOTH OF THESE IN"
01220PRINT"CASE YOU HAVEN'T, LET'S TRY THEM OUT. THE RUB-OUT IS FOR ERASING"
01230PRINT"SINGLE CHARACTERS (INCLUDING SPACES) YOU HAVE TYPED. FOR EXAMPLE"
01240PRINT"ENTER A SINGLE DIGIT ";
01250INPUTN
01260PRINT
01270PRINT"YOU TYPED IN THE NUMERAL ";N;"THAT TIME. NOW TYPE IN A NUMBER"
01280PRINT"HAVING FOUR OR FIVE DIGITS, AND FOLLOW IT IMMEDIATELY WITH TWO"
01290PRINT"RUB-OUTS FOLLOWED BY ONE OR TWO"
01291PRINT"OTHER DIGITS. TRY IT.";
01300INPUTM
01310PRINT
01320PRINT"YOU TYPED IN THE NUMERAL ";M;"THAT TIME. SEE HOW IT WORKS?"
01330PRINT"A SINGLE RUB-OUT WOULD HAVE ERASED THE LAST DIGIT, THREE RUB-OUTS"
01340PRINT"THE LAST THREE DIGITS, AND SO ON. THE OTHER EDIT COMMAND I"
01350PRINT"MENTIONED, 'CONTROL U', WILL DELETE AN ENTIRE LINE OR EVEN SOME"
01360PRINT"COMMANDS, SUCH AS 'SAVE', IF IT IS USED PRIOR TO THE CARRIAGE"
01370PRINT"RETURN. TRY IT WHEN YOU WANT TO CANCEL A LINE YOU HAVE TYPED."
01380PRINT"I'M OUT OF PROGRAM SPACE AGAIN, SO CALL 'TUTR17*' AND"
01390PRINT"WE'LL CONTINUE - SEE YOU THERE -"
99999END