home *** CD-ROM | disk | FTP | other *** search
- Any programmer who has worked on more than one
- computer system will tell you about subtle
- differences among them. As standard as COMAL is, it
- also must deal with system variations. ANYONE
- PROGRAMMING ON ONE COMPUTER FOR PERSONAL USE DOES
- NOT HAVE TO WORRY ABOUT THIS. However, those who
- use several systems should make a point of learning
- the differences. For example, graphics were omitted
- from the COMAL standard because of the
- incompatibility of the screen and color resolution
- on various computers. HOWEVER, THERE IS A COMMON
- SET OF GRAPHICS/TURTLE KEYWORDS.
-
- One difference comes with devices and filenames.
- COMAL usually supports the naming conventions of
- the specific computer system. Commodore filenames
- can contain as many as 16 characters, while IBM and
- CP/M names are restricted to eight characters plus
- a three character extension. IBM and Amiga also
- support subdirectories and time/date stamping of
- files. Commodore disk drive names use numbers; CP/M
- and IBM use letters; Amiga uses words such as DF0:.
- All COMALs call the screen and printer DS: and LP:,
- except IBM, which uses the name CON: for the screen
- and several names for the printers.
-
- Another difference concerns data storage. Most
- computers can use 5 or 3 inch disks, yet each
- computer has its own method of storing information
- on that disk. Thus an IBM PC cannot read a disk
- written on a Commodore 1541 drive. However, this
- is not the only problem. There are ways to transfer
- data between different computer systems (including
- modem transfers). But even if the computers can
- share data, there still is one more factor to
- consider.
-
- Different methods are used to represent data and
- programs. The user never needs to understand this,
- that is one of COMAL's jobs. What is important to
- the user is knowing that COMAL has two methods for
- storing programs and data on disk. One uses compact
- files for quick access. WRITE FILE and SAVE create
- these efficient files. They can only be understood
- by the version of COMAL that wrote them. COMAL also
- supports ASCII text files which can be read by most
- computer software including the other versions of
- COMAL. LIST, DISPLAY, and PRINT FILE produce ASCII
- files.
-
- A debate has been going on for years concerning the
- null string and the IN operator. For example, what
- should "" IN "abc" return? The COMAL standard
- originally stated that the result was to be TRUE
- (true has a value of 1). A slight enhancement on
- this theme returns the length of the second string
- plus one. This value is accepted as true, and it
- allows a program to differentiate between the null
- string and a string matching the first character in
- the second string. Now, Common COMAL specifies that
- the null string is not part of any string. Thus
-
- "" IN "text"
-
- will always be FALSE.
-
- A similar situation involves KEY$. What should it
- return if no key is pressed? Power Driver and C64
- COMAL cartridge return CHR$(0); other COMALs return
- "" (null string).
-
- Another situation involves PRINTing several items
- on one line. There are 3 common ways to do this:
-
- * with no space between the items
- * with one space between items
- * using a preset tab zone system
-
- If you do not use the ZONE statement to set up your
- own tab zone intervals all COMALs will be
- identical: a comma (,) gives no space between items
- and a semicolon (;) gives one space.
-
- However, the tab character has changed from the
- comma to the semicolon, and the default zone
- changed to match. IBM and AmigaCOMAL use the new
- standard. CP/M and Commodore COMALs use the
- original method.
-
- BENCHMARK TIMINGS
-
- Here are some benchmark run times from benchmark
- tests mentioned in the Compatible Article,
- converted into bar charts.
-
- AHLS
- A-C 3.1 ######
- A-B 12.8 ########################
-
- SIEVE
- A-C 6.6 #####
- A-B 16.0 ###########
-
- SUBSTRING REPLACEMENT
- A-C 0.2 #
- A-B 5.1 ###################
-
- A-C=AmigaCOMAL
- A-B=AmigaBASIC
- Base model Amiga 500 was used for the tests.
-