Classic Computer Magazine Archive BEST OF ANTIC VOLUME 1

Translate


Those of you who use your ATARI computers for business applications someday might wish to print checks. It seems like a simple task to write a program that prints the date, amount, and payee, in specific locations on a check form. But who wants to enter the English translation of an amount like ONE THOUSAND FOUR HUNDRED SEVENTY EIGHT AND TWENTY THREE CENTS? If you've got to do that much typing, you might as well write your check by hand.

Your computer should be able to perform this task. Unfortunately, the translation of dollars and cents into English isn't as easy as just printing a number. I spent quite a while using the trial-and-error system to provide you with this program. I'm sure there must be a more efficient algorithm than the one I came up with, but this one does the job.

What I did was to store the English versions of the required numbers in the string N$, and the starting and ending locations of each number in the two dimensional array, N. You enter the number in the normal numeric format, and the program does the required translation. The translation subroutine begins at line 130 and ends at line 320. B$ is a string of 80 blanks, EA$ holds the translated English Amount, and AMOUNT$ stores the numeric amount you enter through the keyboard.

The program will tell you what it wants and includes error-handling routines. The BREAK key and SYSTEM RESET have been left operational.

I haven't gone so far as to actually print your checks, but I have taken care of the tricky part. Add your own inputs for date and payee, position your data according to the layout of your check form, and put your ATARI to work. When you actually print checks, please remember that Jerry starts with a "J."

by Jerry White

Listing: TRANSLAT.BAS Download