Classic Computer Magazine Archive COMPUTE! ISSUE 67 / DECEMBER 1985 / PAGE 10

Readers Feedback

The Editors and Readers of COMPUTE!

If you have any questions, comments, or suggestions you would like to see addressed in this column, write to "Readers' Feedback," COMPUTE!, P.O. Box 5406, Greensboro, NC 27403. Due to the volume of mail we receive, we regret that we cannot provide personal answers to technical questions.

Uploading Files

I work in a publications department of a large company that uses IBM PC-compatible computers. I also have a Commodore 64 at home. Is there any way to convert my Commodore word processing files so they can be read by an IBM PC? I have seen programs that convert Apple files to IBM, but not for Commodore. Is it that it cannot be done, or just that no one has done so yet?

Merton Backlund

With the right setup, you can transfer a file between any two computers. We do it almost every day here at COMPUTE!—text files received from outside authors on floppy disk or over the phone lines are uploaded directly into our editorial/typesetting computer system.

In general, the easiest way to transfer files between normally incompatible computers is to link them together over the phone lines with modems. That means each computer must be equipped with its own modem and terminal software (a program that makes the telecommunications link possible). In addition to exchanging word processing files this way, you can also transfer programs—although they'll need to be translated by a programmer before they'll run on the other computer, of course.

If both computers are in the same room, or nearby, sometimes you can avoid the expense of equipping each computer with a modem by using a null modem cable. This is a special cable which links the computers together by connecting to their interface ports (usually the RS-232 serial port). If this is done properly, each computer thinks it is talking to the other via modem, even though no modems are involved. However, null modem cables to fit every possible situation aren't easy to come by. Usually they must be custom-made by a technician familiar with both computers.

In your particular case, modems are the solution, since you want to transfer files over a distance (home to office). If the computer at work will be unattended when you plan to transfer your files, you'll have to equip it with an autoanswer modem that can answer the phone and receive information automatically. Make sure the terminal programs you get allow uploading and downloading (the capability to send and receive files) and are other­wise compatible with the modems.

Before sending a word processing file, delete all special formatting commands from the document, such as those which trigger different printing styles, headers, footers, page numbers, centering, and so on. The other computer's word processor won't understand these formatting commands, and the control codes might interfere with the telecommunications link. The file you're preparing for transfer should be pure text.

One complication in your case is that Commodore and IBM computers use different codes to represent characters, although the codes for both are derivatives of ASCII (American Standard Code for Information Interchange). Though IBM ASCII is nearly identical to standard ASCII, Commodore ASCII is quite different. A good terminal program can convert Commodore ASCII to standard ASCII characters as it sends the file. So if your word processor stores characters as Commodore ASCII codes, you may able to send the files in their present form. However, many popular word processors for the 64 (including COMPUTE's SpeedScript) store characters as screen codes, which are different from ASCII codes. Before sending such a file you must convert each screen code to its ASCII equivalent. Though it's too long to include here, a file converter program was published as part of the article "SpeedScript 3.0: All Machine Language Word Processor for Commodore 64" in COMPUTE!, March 1985. This program converts text files from Commodore screen codes to Commodore ASCII or standard ASCII, and Commodore ASCII files to screen codes.

Your particular situation may require a little additional conversion. On Commodore computers, the code CHR$ (13) performs both a carriage return (moving the cursor back to the left margin) and a line feed (moving the cursor down one line). In IBM ASCII, these are separate functions: CHR$(10) performs a line feed and CHR$(13) does a carriage return. Here's a short IBM program that adds the line feeds:

10 ON ERROR GOTO 60 'Add CHR$ (10) to each CHR$ (13) in text file
20 INPUT "Filename"; N$ : INPUT "Conversion filename"; M$
30 OPEN N$ FOR INPUT AS #1 : OPEN M$ FOR OUTPUT AS #2 : WHILE EOF (1) = 0
40 C$ = INPUT $(1, #1) : PRINT #2, C$; : IF C$ = CHR$ (13) THEN PRINT #2, CHR$ (10);
50 WEND
60 CLOSE 1 : CLOSE 2 : ON ERROR GOTO 0