!*************************** AMUS Program Label ****************************** ! Filename: GETREV.BAS Date: 11/21/89 ! Category: UTIL Hash Code: 202-312-373-670 Version: 88.2C(1) ! Initials: MKE/AM Name: DAVID W. BARROW III ! Company: STONEWALL COMPUTER CENTER Telephone #: 4143752667 ! Related Files: GETREV.DOC ! Min. Op. Sys.: Expertise Level: INT ! Special: ! Description: Program which performs a VERIFY on a directory listing. If any ! mismatches occur, these files are placed into a .AGO file. This .AGO file ! can used by AUTOLOG to download the correct files from a remote system. !***************************************************************************** 01000 ! GETREV.BAS - PRODUCES GETREV.AGO TO GET REVISED SOFTWARE 01010 ! Created by DAVID W. BARROW III at STONEWALL COMPUTER CENTER 01020 ! 1894 Elm Drive, Town of Cedarburg, West Bend, WI 53095 01030 ! Telephone (414) 375-AMOS 01040 ! JANUARY 26, 1988 01050 ! 01060 ! (1) TAKE A DIRECTORY AND VERIFY IT TO A FILE, (2) ELIMINATE 01070 ! THE "VERIFIED" AND PRODUCE THE .AGO FILE TO GET 'EM 01080 ! 01090 ! (of course if you want to SEND an update (pretty please) just 01100 ! (VUE the GETREV.AGO file and Global the REC to TR) 01110 ! 01120 ! Other modifications are left to the user's wildest imagination! 01130 ! 01140 ! M O D I F I C A T I O N H I S T O R Y 01150 ! Date Rev. Who What 01160 ! -------- --- --- ------------------------------------- 01170 ! 01-28-88 B DWB Shorten to three phases, p/o stat.s 01180 ! 02-01-88 C DWB Put date and time into output files 01190 ! 01200 01210 PROGRAM GETREV,88.02C(01) 01220 01230 MAP1 CONTINUE,S,1,"N" ! Answer to "Do you wish to continue?" 01240 MAP1 COUNTER,F,6,0 ! Loop counter 01250 MAP1 EXIST,F,6,0 ! LOOKUP Answer 01260 MAP1 DIRNAM,S,10 ! Name of directory file to be updated 01270 MAP1 FILNAM,S,10 ! names/files accessed by this program 01280 MAP1 OVER'WRITE,S,180 ! WARNING 01290 MAP1 REM'DEV,S,6,"" ! Remote Device ( e.g. DSK0:) 01300 MAP1 Q$,S,1,CHR(34) ! Puts a quote in output file 01310 MAP1 SPEC'END,F,6,0 ! Position of end of file'specification 01320 01330 ! Let the user know what is going on 01340 PRINT TAB(-1,0) ! Clear the screen 01350 PRINT TAB(01,01); "GETREV - A program to create an AUTOLOG "; & " .AGO file to get revised programs" 01360 PRINT TAB(03,01); " Written by David W. Barrow III at "; & "STONEWALL COMPUTER CENTER" 01370 PRINT TAB(04,01); " 1894 Elm Drive, Town of "; & "Cedarburg, West Bend, WI 53095" 01380 PRINT TAB(05,01); " Telephone "; & "(414) 375-AMOS" 01390 01400 PRINT TAB(07,01); TAB(-1,10) ! Clear the rest of the screen 01410 PRINT TAB(07,01); "More information on AUTOLOG? (Y/N) (def=N) "; 01420 INPUT "", CONTINUE 01430 CONTINUE = UCS(CONTINUE) 01440 IF ( CONTINUE <> "Y" ) & THEN GOTO DISPLAY'INFO 01450 PRINT TAB(09,01); "AUTOLOG and its 'little brother' DYALOG "; & "are modem communications programs" 01460 PRINT TAB(10,05); "available from your DEALER, the author of "; & "this program, or from " 01470 PRINT TAB(12,15); "SOFT MACHINES, INC." 01480 PRINT TAB(13,15); "Post Office Box 3701" 01490 PRINT TAB(14,15); "Champaign, IL 61821" 01500 PRINT TAB(16,15); "Telephone (217) 351-7199" 01510 01520 PRINT TAB(18,05); "They also have developed the following "; & "software:" 01530 PRINT TAB(19,15); "FOLDERS - create 'sub' disks" 01540 PRINT TAB(20,15); "GOFAST - Disk cache" 01550 PRINT TAB(21,15); "ZIP - Virtual disk" 01560 PRINT TAB(22,01); 01570 STOP 01580 01590 DISPLAY'INFO: 01600 PRINT TAB(07,01); TAB(-1,10) ! Clear the rest of the screen 01610 PRINT TAB(07,01); "GETREV will take any directory " & "created using 'DIR/D/H/V filnam.ext='" 01620 PRINT TAB(09,36); "AND THEN" 01630 PRINT TAB(11,05); "Phase 1 - Creates the files it needs" 01640 PRINT TAB(12,05); "Phase 2 - VERIFYs the directory file" 01650 PRINT TAB(13,05); "Phase 3 - Creates GETREV.AGO to get all the " & "files that were not VERIFIED" 01660 01670 PRINT TAB(15,01); "The user will be asked to input:" 01680 PRINT TAB(16,05); "(1) The name of the directory XXXXXX{.DIR}" 01690 PRINT TAB(17,10); "filnam default=AMOS; ext default=.DIR" 01700 PRINT TAB(18,05); "(2) The logical device on the update system " 01710 PRINT TAB(19,10); "(e.g. PHG0:) (default=DSK0:)" 01720 PRINT TAB(20,15); "(That's Pretty Humongeous Drive 0)" 01730 01740 PRINT TAB(22,01); 01750 STOP 01760 01770 ! Abort if VERIFY.LIT doesn't exist 01780 LOOKUP "DSK0:VERIFY.LIT[1,4]", EXIST 01790 IF ( EXIST < 1 ) & THEN PRINT TAB(09,10); "I can't work without "; & "DSK0:VERIFY.LIT[1,4] - Sorry" & : END 01800 01810 DIR'NAME: ! Get the name of the directory to be updated 01820 PRINT TAB(07,01); TAB(-1,10) 01830 PRINT TAB(07,01); "What is the directory to be updated? "; & "(def filnam=AMOS) (def ext=.DIR) "; 01840 INPUT "", DIRNAM 01850 DIRNAM = UCS(DIRNAM) 01860 XCALL STRIP, DIRNAM 01870 IF ( LEN(DIRNAM) = 0 ) & THEN DIRNAM = "AMOS.DIR" 01880 SPEC'END = INSTR(1,DIRNAM,".") 01890 IF ( SPEC'END = 0 ) & THEN DIRNAM = DIRNAM + ".DIR" 01900 LOOKUP DIRNAM, EXIST 01910 IF ( EXIST < 1 ) & THEN PRINT TAB(09,10); "I can't find "; DIRNAM & : PRINT; CHR$(7) & : STOP & : GOTO DIR'NAME 01920 01930 FOREIGN'DEV: ! Get the foreign logical to copy from 01940 PRINT TAB(08,01); TAB(-1,10) 01950 PRINT TAB(09,01); "What is the Remote Logical Device to "; & "copy from? (XXXNN:) (def=DSK0:)"; 01960 INPUT "", REM'DEV 01970 REM'DEV = UCS(REM'DEV) ! Just in case 01980 XCALL STRIP, REM'DEV ! Strip trailing spaces 01990 IF ( LEN(REM'DEV) = 0 ) & THEN REM'DEV = "DSK0:" 02000 IF ( 0 = INSTR(1,REM'DEV,":") ) & THEN PRINT; CHR$(7) & : PRINT TAB(13,10); "YOU NEED A COLON (:)" & : STOP & : GOTO FOREIGN'DEV 02010 02020 ! Check to see if any name conflicts 02030 DATA VERIFY.LST,GETREV.AGO,UTGRP3.BAS,UTGRP3.RUN,UTGRP1.CMD 02040 02050 FOR COUNTER = 1 TO 5 ! Conflict loop 02060 READ FILNAM 02070 LOOKUP FILNAM, EXIST 02080 IF ( EXIST <> 0 ) & THEN OVER'WRITE = OVER'WRITE + FILNAM + ", " 02090 NEXT COUNTER 02100 02110 IF ( LEN(OVER'WRITE) > 2 ) & THEN PRINT; CHR(7) & : PRINT; "WARNING! The following files WILL "; & "be overwritten: "; OVER'WRITE & : PRINT & : PRINT; "Do you wish to continue? (Y/N) (DEF=N)"; & : INPUT ""; CONTINUE & : IF ( UCS(CONTINUE) <> "Y" ) & THEN END 02120 02130 PHASE1: 02140 PRINT TAB(10,01); TAB(-1,10) 02150 PRINT; "Phase 1 of GETREV - Create necessary files" 02160 OPEN #1, "UTGRP1.CMD", OUTPUT 02170 PRINT #1; "; UTGRP1.CMD - PHASE 1 OF GETREV" 02180 PRINT #1 02190 PRINT #1; "; COMPILE THE BASIC FILES" 02200 PRINT #1; "COMPIL UTGRP3.BAS" 02210 PRINT #1 02220 PRINT #1; ":< Phase 2 of GETREV - VERIFY/F "; DIRNAM 02230 PRINT #1; ">" 02240 PRINT #1; "VERIFY/F "; DIRNAM 02250 PRINT #1 02260 PRINT #1; ":R" 02270 PRINT #1; "RUN UTGRP3" 02280 PRINT #1 02290 PRINT #1; ":S" 02300 PRINT #1; "ERASE UTGRP3.*,UTGRP1.CMD" 02310 PRINT #1 02320 PRINT #1; ":R" 02330 PRINT #1; "XY 20 1" 02340 PRINT #1; ":" 02380 CLOSE #1 02390 02400 ! PHASE 3 takes VERIFY.LST, eliminates those that are "VERIFIED" 02410 ! and outputs the others into GETREV.AGO 02420 02430 OPEN #3, "UTGRP3.BAS", OUTPUT 02440 PRINT #3; "! UTGRP3.BAS - PHASE 3 OF GETREV" 02450 PRINT #3; "! Takes the VERIFY.LST and prints the "; & "not 'VERIFIED' files to GETREV.AGO" 02460 PRINT #3 02470 PRINT #3; "MAP1 COUNTER,F,6,0 ! Counts VERIFY lines" 02480 PRINT #3; "MAP1 DA'DT'TIM,S,45 ! Gets from XCALL ODTIM" 02490 PRINT #3; "MAP1 FIL'SPEC,S,26 ! File specification" 02500 PRINT #3; "MAP1 FIND'POS,F,6,0 ! INSTR Answer" 02510 PRINT #3; "MAP1 GET'COUNT,F,6,0 ! #/files in GETREV.AGO" 02520 PRINT #3; "MAP1 INLINE,S,80 ! Holds a line from VERIFY" 02530 PRINT #3 02540 PRINT #3; " PRINT; "; Q$; " Phase 3 of GETREV - "; & "Skip the 'VERIFIED' files"; Q$ 02550 PRINT #3; " PRINT; "; Q$; " List the rest in "; & "an AUTOLOG .AGO file to get 'em"; Q$ 02560 PRINT #3 02570 PRINT #3; " OPEN #3, "; Q$; "VERIFY.LST"; Q$; ", INPUT"; & " ! Opens the listing from VERIFY" 02580 PRINT #3 02590 PRINT #3; " OPEN #4, "; Q$; "GETREV.AGO"; Q$; ", OUTPUT"; & " ! Creates the AUTOLOG command file" 02600 PRINT #3; " PRINT #4; "; Q$; "; GETREV.AGO - "; & "Produced by GETREV.RUN from "; & "the "; DIRNAM; " directory"; Q$ 02610 PRINT #3; " XCALL ODTIM, DA'DT'TIM,0,0,-1" 02620 PRINT #3; " PRINT #4; "; Q$; "; Produced on "; & Q$; "; DA'DT'TIM" 02630 PRINT #3; " PRINT #4; "; Q$; "; This file "; & "will be used by AUTOLOG to get these files "; & "updated"; Q$ 02640 PRINT #3; " PRINT #4; "; Q$; ":T"; Q$ 02650 PRINT #3 02660 PRINT #3; "PHASE3:" 02670 PRINT #3; " INPUT LINE #3, INLINE" ! Get a line from VERIFY.LST 02680 PRINT #3; " IF ( EOF(3) <> 0 ) &" 02690 PRINT #3; " THEN GOTO EXIT3"; 02700 PRINT #3; " ! Check for End-of-File" 02710 PRINT #3; " COUNTER = COUNTER + 1" 02720 PRINT #3; " IF ( INLINE[1,1] = SPACE(1) )"; & " &" 02730 PRINT #3; " THEN GOTO EXIT3"; & " ! Check for blank line" 02740 PRINT #3; " IF ( INSTR(1,INLINE,"; Q$; & "VERIFIED"; Q$; ") <> 0 ) &" 02750 PRINT #3; " THEN GOTO PHASE3 "; & "! If you're good - you're good" 02760 PRINT #3; " ! Find the ] at end of the P,Pn" 02770 PRINT #3; " FIND'POS = INSTR(1,INLINE,"; Q$; "]"; Q$; ")" 02780 PRINT #3; " FIL'SPEC = INLINE[1,FIND'POS]" 02790 PRINT #3; " ! Assemble the first part of the get em line" 02800 PRINT #3; " PRINT #4; "; Q$; "REC "; Q$; "; FIL'SPEC; " & Q$; "="; Q$; "; "; Q$; REM'DEV; Q$; "; "; 02810 PRINT #3; " ! Strip off the device" 02820 PRINT #3; " FIND'POS = INSTR(1,FIL'SPEC,"; Q$; ":"; Q$; ")" 02830 PRINT #3; " FIL'SPEC = FIL'SPEC[(FIND'POS+1), 26]" 02840 PRINT #3; " XCALL STRIP, FIL'SPEC" 02850 PRINT #3; " ! Finish the get em line" 02860 PRINT #3; " PRINT #4; FIL'SPEC" 02870 PRINT #3; " GET'COUNT = GET'COUNT + 1" 02880 PRINT #3; " GOTO PHASE3" 02890 PRINT #3 02900 PRINT #3; "EXIT3:" 02910 PRINT #3; " INPUT LINE #3, INLINE ! Get count "; & "from VERIFY.LST" 02920 PRINT #3; " XCALL STRIP, INLINE" 02930 PRINT #3; " PRINT ! Skip a line" 02940 PRINT #3; " PRINT; "; Q$; "There were "; Q$; & "; COUNTER; "; Q$; "files listed in the directory."; Q$ 02950 PRINT #3; " PRINT ! Skip a line" 02960 PRINT #3; " PRINT; "; Q$; "VERIFY found "; Q$; "; INLINE" 02970 PRINT #3; " PRINT; "; Q$; "GETREV.AGO is ready to "; & "get "; Q$; "; GET'COUNT; "; Q$; " of them."; Q$ 02980 PRINT #3; " PRINT ! Skip a line" 02990 PRINT #3; " CLOSE #3" 03000 PRINT #3; " CLOSE #4" 03010 PRINT #3; " END" 03020 CLOSE #3 03030 03040 ! Now start working on it 03050 CHAIN "UTGRP1.CMD" 03060 END 03070 03080 !* ** *** END OF GETREV.BAS *** ** *