'Copyright 2000 The American Cryptogram Association (ACA) '3613 Piedmont Drive, Plano TX 75075-6234 'All rights reserved. 'Program code from the Computer Column 'for Nov/Dec 2000. The program converts 'a word list from Unix text format to 'MSDOS text format. See the Computer 'Column for details. 'Note: To keep the program simple, it's 'not very fast. It may take 1-3 minutes 'to convert a file with 100,000 words. ' Unix2Dos.bas Print "Enter name of file to convert"; Print " from Unix to DOS format: "; Input Fi$ : Fi$=Ucase$(Fi$) Print "Enter name of new file to "; Print "receive the converted list: "; Input Fo$ : Fo$=Ucase$(Fo$) If Fi$=Fo$ Then Print "?Use different file names." End End If Open Fi$ for binary as #1 Open Fo$ for binary as #2 Cr$=Chr$(13) 'Carriage return = 13 Nl$=Chr$(10) 'New-line = 10 NoCvt$=Fi$ + " is in DOS format and " NoCvt$=NoCvt$ + "was not converted." C$=" " 'Set C$ length to get one char While not eof(1) 'Loop: Copy one char Get #1,,C$ 'at a time, inserting If C$=Cr$ then 'Cr$ before each new- Print NoCvt$ 'line. If Cr$ is Close #2 'found in file, quit Kill Fo$ 'since file is not in End 'Unix format. End If If C$=Nl$ then Put #2,,Cr$ If Asc(C$)<>0 then Put #2,,C$ wend 'End of copy loop close #1 close #2