'File extension changer version 1.2 'By , Nathan 'Description: a) simply copies a file with a new extension 'b) view a files contents DECLARE SUB getdata () DECLARE SUB putdata () DECLARE SUB menu (stop1) DECLARE SUB viewdata () DECLARE SUB opener () SCREEN 12 CLS CALL opener DO UNTIL stop1 = 1 CALL menu(stop1) LOOP END SUB getdata CLS quit = 0 PRINT "Type 'quit' to exit." INPUT "What is the FULL file name"; filen$ IF UCASE$(filen$) = UCASE$("quit") THEN quit = 1 IF quit = 0 THEN INPUT "What is the FULL name of the new file"; newf$ OPEN filen$ FOR INPUT AS #1 OPEN newf$ FOR OUTPUT AS #2 DO INPUT #1, filedat$ PRINT #2, filedat$ LOOP UNTIL EOF(1) CLOSE #1 CLOSE #2 PRINT "Done. Your data has been saved as "; COLOR 1 PRINT newf$ COLOR 4 DO WHILE INKEY$ = "" LOOP END IF END SUB SUB menu (stop1) CLS LOCATE 7, 14 PRINT "What do you want to do?" LOCATE 8, 14 PRINT "1) Get data from a file and convert extension" LOCATE 9, 14 PRINT "2) View a files contents" LOCATE 10, 14 PRINT "3) Quit" LOCATE 11, 14 INPUT " "; ch1 SELECT CASE ch1 CASE 1 CALL getdata CASE 2 CALL viewdata CASE 3 stop1 = 1 CASE ELSE PRINT "Not a valid selection" PRINT "Press and key to continue." DO WHILE INKEY$ = "" LOOP END SELECT END SUB SUB opener LINE (20, 20)-(620, 460), 1, B PAINT (10, 10), 1 COLOR 1 LOCATE 10, 20 COLOR 4 PRINT "Welcome to the file extension changer!" stop1 = 0 DIM filedat$(60) DO WHILE INKEY$ = "" LOOP END SUB SUB viewdata CLS quit = 0 PRINT "Type 'quit' to exit." INPUT "What is the FULL file name"; filen$ COLOR 1 IF UCASE$(filen$) = UCASE$("quit") THEN quit = 1 IF quit = 0 THEN OPEN filen$ FOR INPUT AS #3 DO INPUT #3, fstuff$ PRINT fstuff$ LOOP UNTIL EOF(3) COLOR 4 PRINT "Press any key to continue." DO WHILE INKEY$ = "" LOOP END IF END SUB