1000 EXTEND & ! & ! Program to reorganize WORD-11 file names & ! & ! 14-Jan-88 F. Mitchell Erskine College & ! & ! 27-Jan-88 last edit *M & ! & ! Author: W. Franklin Mitchell, Jr. & ! Director of Computer Services & ! Erskine College, Due West, South Carolina & ! & ! Copyright (c) 1988 & ! Erskine College, Due West, South Carolina & ! & ! *********************************************************************** & ! * This software is furnished without charge by Erskine College and * & ! * may be copied only with the inclusion of the author's name and * & ! * copyright notice. No title to or ownership of this software is * & ! * hereby transmitted. Neither Erskine College nor the author assumes * & ! * any responsibility for the use or reliability of this software. The * & ! * author welcomes comments and/or bug reports mailed to Franklin * & ! * Mitchell, Erskine College, Box 86W, Due West, South Carolina 29639. * & ! *********************************************************************** & 1010 DIM F$(200%), M%(30%), R%(30%) & 1020 ON ERROR GOTO 1150 & 1030 PRINT & \ PRINT "WORD-11 file index number reorganizer V1.0 "; & \ PRINT DATE$(0%); ' '; TIME$(0%) & \ PRINT & \ PRINT "This program reorganizes your WORD-11 document numbers by "; & \ PRINT "renumbering all" & \ PRINT "documents. For example, if your account has WORD-11 "; & \ PRINT "documents 1, 5, and 9;" & \ PRINT "they become 1, 2, and 3 respectively. Your account may "; & \ PRINT 'not have any ".Z11"' & \ PRINT 'files since that extension is used during the renaming '; & \ PRINT 'process.' & \ PRINT & \ PRINT "Your WORD-11 files are on which disk "; & \ INPUT LINE DISK.ACCT$ & \ DISK.ACCT$ = CVT$$(DISK.ACCT$, 38%) & 1040 CHANGE SYS(CHR$(6%) + CHR$(-10%) + DISK.ACCT$) TO M% & \ PROJ.PROG$ = "" & \ PROJ.PROG$ = '[' + NUM1$(M%(6%)) + ',' + NUM1$(M%(5%)) + ']' IF M%(6%) & \ DISK$ = 'SY:' & \ DISK$ = CHR$(M%(23%)) + CHR$(M%(24%)) + NUM1$(M%(25%)) + ':' & IF (M%(27%) + SWAP%(M%(28%))) AND 4096% & \ DISK.ACCT$ = DISK$ + PROJ.PROG$ & 1050 M%(0%) = 30% & \ M%(1%) = 6% & \ M%(2%) = 15% & \ M%(3%), M%(4%) = 0% & \ PRINT & \ PRINT 'Please wait...' & 1060 CHANGE M% TO M$ & \ CHANGE SYS(M$) TO R% & \ DIR% = DIR% + 1% & \ M%(3%) = DIR% & \ M%(4%) = SWAP%(DIR%) & \ EXT$ = RAD$(R%(11%) + SWAP%(R%(12%))) & \ GOTO 1060 IF EXT$ <> 'W11' & \ GOTO 1060 IF RAD$(R%(7%) + SWAP%(R%(8%))) <> 'W11' & \ F% = F% + 1% & \ GOTO 1070 IF F% > 200% & \ F$(F%) = RAD$(R%(9%) + SWAP%(R%(10%))) & \ GOTO 1060 & 1070 PRINT & \ PRINT "?Limit of 200 WORD-11 files exceded." & \ GOTO 32767 & 1080 PRINT & \ PRINT NUM1$(F%); ' WORD-11 files found in '; DISK.ACCT$; '.' & 1090 PRINT & \ PRINT 'Sorting...' & \ GOSUB 1180 & \ OPEN "NL:" AS FILE 1%, RECORDSIZE 28% & \ FIELD #1%, 4% AS D1$, 3% AS F1$, 3% AS B1$, 4% AS E1$, & 4% AS D2$, 3% AS F2$, 3% AS B2$, 4% AS E2$ & \ FIELD #1%, 14% AS FIL1$, 14% AS FIL2$ & \ LSET D1$ = DISK.ACCT$ & \ LSET D2$ = DISK.ACCT$ & \ LSET F1$ = "W11" & \ LSET F2$ = "W11" & \ LSET E1$ = ".W11" & \ LSET E2$ = ".Z11" & \ PRINT & \ PRINT "Renaming..." & 1100 FOR L% = 1% TO F% & \ LSET B1$ = F$(L%) & \ LSET B2$ = F$(L%) & \ NAME FIL1$ AS FIL2$ 1110 NEXT L% & \ LSET E1$ = ".Z11" & \ LSET E2$ = ".W11" & \ PRINT & \ PRINT "Renumbering..." & 1120 FOR L% = 1% TO F% & \ LSET B1$ = F$(L%) & \ RSET B2$ = NUM1$(1000% + L%) & \ NAME FIL1$ AS FIL2$ 1130 NEXT L% & \ PRINT & \ PRINT "Rebuilding the WORD-11 index using WORD-11 T RB..." & \ SLEEP 2% & 1140 D$ = SYS(CHR$(14%) + "WORD T RB") & 1150 RESUME 1080% IF ERR = 5% AND ERL = 1060% & 1160 PRINT & \ PRINT "?Unexpected W11REN error"; ERR & \ PRINT & \ ON ERROR GOTO 0 & \ GOTO 32767 & 1170 ! Shell - Metzner Sort: & 1180 M6% = F% 1190 M6% = M6%/2% & \ RETURN IF M6% = 0% & \ K6% = F% - M6% & \ J6% = 1% 1200 I6% = J6% 1210 L6% = I6% + M6% & \ GOTO 1220 IF F$(I6%) <= F$(L6%) & \ T$ = F$(I6%) & \ F$(I6%) = F$(L6%) & \ F$(L6%) = T$ & \ I6% = I6% - M6% & \ GOTO 1210 IF I6% >= 1% 1220 J6% = J6% + 1% & \ GOTO 1190 IF J6% > K6% & \ GOTO 1200 & 32767 END