8-Bit Software Online Conversion

Directory Rename Utility - Listing

10*|" 20*|" Tree Rename V.1 30*|" 40*|" Written by Alex Savvides 50*|" Renames whole directories 60*|" For 8-Bit Public Domain 70*|" | 80: 90IFPAGE<>&1900THENPRINT'" Set PAGE t o &1900 and re-load":END 100: 110MODE7:VDU23;8202;0;0;0; 120*FX4 2 130*FX11 140CLOSE#0 150ONERRORPROCerror:END 160DIMfile$(31) 170FORK=1TO2 180PRINTTAB(0,K);" ";CHR$157;CHR$141" Tree Rename Version 1" 190NEXT 200PRINT'SPC(7);" Written by Alex Savv ides" 210PRINTTAB(0,24);" ";CHR$157;" An 8-Bit Public Domain Utility"; 220VDU28,1,22,39,6 230ONERRORPROCerror 240PRINT" Please wait a while ..." 250FORI=&0E00TO&F00 260?I=0 270NEXT 280CLS 290INPUTLINE" Enter drive :"DR$ 300IFDR$=""""ORDR$=""ORLEN(DR$)>1ORVAL (DR$)>3THENVDU7,11:GOTO290 310OSCLI"DRI. "+DR$ 320PRINT'" Insert disk in drive ";DR$; " and hit a key"' 330A=GET 340*. 350PROCinput("Enter source directory", """:.") 360S$=G$ 370PROCinput("Enter rename directory", """:.") 380D$=G$ 390*ACCESS*.* 400PROCfiles 410PROCrename 420*. 430INPUT'" Another disk (Y/N) ? "A$' 440IFA$="Y"THENGOTO290 450CALL!-4 460END 470: 480DEFPROCfiles 490PRINT'"Reading ..."' 500*FX3 2 510*DIR$ 520*. 530*FX3 540A%=&0E08 550B%=0 560REPEAT 570IF?(A%+7)=0THENR$="$."ELSER$=CHR$(? (A%+7))+"." 580file$(B%)=R$ 590D%=0 600REPEAT 610IF?(A%+D%)>0OR?(A%+D%)<>&FFTHENfile $(B%)=file$(B%)+CHR$(?(A%+D%)) 620D%=D%+1 630UNTILD%=7OR?(A%+D%)=32 640IFLEFT$(file$(B%),1)<>S$THENGOTO670 650PRINT" ";file$(B%) 660B%=B%+1 670A%=A%+8 680UNTIL?A%=0ORA%=&F00ORB%=32 690IFB%=0THENPRINT" No files found in directory '";S$;"'":GOTO430 700ENDPROC 710: 720DEFPROCrename 730PRINT'"Renaming ..."' 740FORn=0TOB%-1 750a$=file$(n) 760z=LEN(a$)-2 770b$=MID$(a$,3,z) 780IFLEFT$(a$,1)<>S$THENGOTO810 790OSCLI"RENAME "+file$(n)+" "+D$+"."+ b$ 800PRINT;" ";a$;SPC(8-LEN(b$));" ] "; D$;".";b$ 810NEXT 820ENDPROC 830: 840DEFPROCerror 850*FX3 860VDU7,12 870IFERR=17THENENDPROC 880PRINT" An error has occured:" 890REPORT:PRINT" at line ";ERL' 900PRINT" Press a key...":*FX21 910key=GET 920ENDPROC 930: 940DEFPROCinput(text$,forbid$) 950PRINT'" ";text$;" :"; 960REPEAT 970G$=GET$ 980UNTILINSTR(forbid$,G$)=0 990PRINTG$ 1000ENDPROC