The Fort Worth Scene, in the November 1981 issue of the TRS-80 Microcomputer News, mentioned an axiom worth reexamining: "Never overlook a program just because you don't see an immediate use for it." The editor was referring to the versatility of the Model II Text Editor package on language development packages. I would like to discuss some possibilities using the Model III BASIC, COBOL, BASIC COMPILER, FORTRAN, and EDITOR/ASSEMBLER editors, and uses of our old (and still champ) text editor, DISK SCRIPSIT.

The TRS-80 Model III BASIC editor is extremely powerful, but some limitations may be easily overcome by the use of DISK SCRIPSIT. If your BASIC program were written for video display output only, how would you change each occurrence of 'PRINT' to 'LPRINT'? Using the Model III BASIC editor could be very tedious, and you might overlook one or more changes deeply hidden within a multi-statement line. Enter DISK SCRIPSIT. Save the BASIC program to disk in ASCII format, load it into SCRIPSIT, and make the necessary changes via the global FIND or REPLACE commands. Anywhere from one to 255 changes of 'PRINT' to 'LPRINT' are made for you in seconds!

EDITOR'S NOTE: Be certain you don't also change PRINT m to LPRINT #11

As a prerequisite, the BASIC source program must be stored in ASCII format, a simple procedure. But, did you know that your source programs created in COBOL, FORTRAN, BASIC COMPILER, and even EDITOR/ ASSEMBLER may be loaded into DISK SCRIPSIT? This adds a new versatility to your program development; these language development packages save your source file to disk in ASCII format, directly. There are several immediate benefits to this. Not only are files easily edited, but they are in the format required for transmission over telephone lines, and may be corrected by the new SCRIPSIT DICTIONARY! Imagine - no more FATAL ERRORS because you 'missspelt' a command!

I use a multi-purpose data entry and sort routine on my Model III that I wrote in COBOL. Those of you who use COBOL know that the strength of COBOL is also its greatest liability: all variables, disk file types, output display formats, and intermediate procedures must be strictly defined before any logic is coded. This makes COBOL easy to read and debug, but any error causes the program to fail totally, and error-correction requires editing and time-consuming recompiling. Hence, to be useful, my multi-purpose program must be easily changeable with a minimum possibility of errors being introduced. SCRIPSIT makes this possible.

Let's say that I wish to change a particular COBOL variable from 'WEEKLY-PAYROLL-HOURS' to 'AMOUNT-PURCHASED'. Global REPLACE makes this easy. In addition, I will probably have to change the 'PICTURE', or display format, for a variable. 'PICTURE X(9)' or nine alphanumeric characters, might become 'PICTURE 999B99B9999' or three numbers, a blank space, two numbers, space, and four numbers; this is how a social security number might be displayed. In the event my program contained more than one variable with the same 'PICTURE' description, I could at least use the FIND command in DISK SCRIPSIT to be certain I did not overlook any required changes. EDITOR'S NOTE: Always work from backups, not from your original document files.

The same procedure is useful in FORTRAN, EDITOR/ ASSEMBLER, and BASIC COMPILER source files. The device assignment in a 'WRITE' statement could be changed in FORTRAN, or 'SET' in BASIC could be changed to BASIC COMPILER'S 'CRT'. How about finding each occurrence of a particular hexadecimal address in an EDITOR/ASSEMBLER listing?

By experimenting with different combinations of editors on a source file of another language, I found some interesting possibilities for development of source files, and for 'pretty printing'. The FORTRAN, COBOL, BASIC COMPILER, and EDITOR/ASSEMBLER editors are remarkably interchangeable. One need only be careful to save a source file with the appropriate extension, or the editor supplies its own for that language. Because of the differences in the way line numbers are created and displayed, and the way tabs are handled (visible on the coding forms for each particular language), some combinations do not work, or yield errors. For example, to reload into CEDIT, a file that has been edited and saved under SCRIPSIT, you must go into DEBUG and insert the character for CEDIT to recognize the EOF marker. The following are some that do work: EDITOR/ASSEMBLER and FORTRAN source files loaded into the CEDIT COBOL editor produce a compressed but very readable listing. This could be useful in the preparation of an article in column format. BASIC COMPILER'S BEDIT handles files similarly to CEDIT, except BEDIT renumbers COBOL source files by increments of one. EDITOR/ASSEMBLER does the same.

My experience is primarily with COBOL, and I invite you to try other possibilities. Just save your original copy, and only perform experiments on a backup of your file. If you jump between language development packages often enough to become confused, try writing all your programs with your favorite editor, regardless of language; it often works. And don't forget about DISK SCRIPSIT, the text editor that looks like it was designed to be used with all these languages!

Was this article helpful?

0 0

Post a comment