home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / DRI-archive / roche / WHATSCML.TXT < prev    next >
Internet Message Format  |  2009-12-11  |  10KB

  1. From: "Arobase, Salle multimΘdia" <arobase1.rochef...@wanadoo.fr>
  2. Newsgroups: comp.os.cpm
  3. Subject: What is COMAL ?
  4. Date: Wed, 20 Mar 2002 02:42:32 +0100
  5. Organization: Wanadoo, l'internet avec France Telecom
  6. Lines: 222
  7. Message-ID: <a7aehi$5ca$1@wanadoo.fr>
  8. NNTP-Posting-Host: apoitiers-102-2-1-124.abo.wanadoo.fr
  9. X-Trace: wanadoo.fr 1016642930 5514 193.253.213.124 (20 Mar 2002 16:48:50 GMT)
  10. X-Complaints-To: abuse@wanadoo.fr
  11. NNTP-Posting-Date: 20 Mar 2002 16:48:50 GMT
  12. X-Priority: 3
  13. X-MSMail-Priority: Normal
  14. X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
  15. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
  16.  
  17. I found the following file while searching.
  18.  
  19. Among other things, I learned that the
  20. IBM PC version was called "IBM PC
  21. COMAL 2.2".
  22.  
  23. There were also a "MacCOMAL"
  24. and a "AmigaCOMAL".
  25.  
  26. Hope that you will find this file
  27. as interesting as I found it.
  28.  
  29. I can't stand to have it under CP/M-86 Plus!
  30.  
  31. Yours Sincerely,
  32. "French Luser"
  33.  
  34. WHATSCML.TXT
  35. ------------
  36.  
  37. (Edited by Emmanuel ROCHE.)
  38.  
  39.  
  40. WHAT IS COMAL?
  41. --------------
  42.  
  43. COMAL was designed  with the  BEGINNER in  mind, including  many
  44. interactive  features.    It  is   tolerant  of   mistakes,  yet
  45. discourages bad habits. This allows a beginner to develop skills
  46. necessary in advanced structured programming languages, such as,
  47. well,  COMAL.   The  widely  acclaimed  TURTLE  GRAPHICS are  an
  48. integral part of COMAL, and have been for nearly a decade.
  49.  
  50. ADVANCED PROGRAMMERS  also  pick  COMAL  as  their  language  of
  51. choice. They utilize the many advanced and powerful  features of
  52. COMAL that beginners do not need to even  know about.   However,
  53. as beginners' programming skills improve, COMAL  always presents
  54. even more power and features for them to use.
  55.  
  56. Let's examine some features  that attract  beginning programmers
  57. and keep advanced programmers.
  58.  
  59. In direct mode, you  interact directly  with the  computer.  You
  60. type in a  command, and  COMAL responds  right away.  A beginner
  61. usually  starts  with a  PRINT statement.   The PRINT  statement
  62. tells the computer to display a message on the screen.   This is
  63. an important command. Would you want a program to calculate your
  64. mortgage payment, if it couldn't  tell you  the answer?   In its
  65. simplest form, the PRINT statement can display a  text constant.
  66. For example, type:
  67.  
  68.         PRINT "hello"
  69.  
  70. and COMAL responds with:
  71.  
  72.         hello
  73.  
  74. COMAL is  also  good with  calculations. When  you balance  your
  75. checkbook, COMAL can help.  If your starting balance  is $313.76
  76. and you wrote two checks ($250.00 and $125.98) type:
  77.  
  78.         PRINT 313.76-250.00-125.98
  79.  
  80. COMAL immediately responds with:
  81.  
  82.         -62.22
  83.  
  84. No wonder  that  check bounced.  Actually, a  useful program  is
  85. usually harder than this. But don't  worry, COMAL  helps you  in
  86. many ways.
  87.  
  88. COMAL provides a full screen editor to help you write  programs.
  89. You don't have to  load a  special program  to use  this editor.
  90. Just type in the program lines  from direct  mode, as  described
  91. above.  A program line consists of a line  number followed  by a
  92. statement.  With its AUTO  command, COMAL  can provide  the line
  93. number for you.  You just type in the statement.
  94.  
  95. COMAL's editor doesn't sit around watching you type  either.  It
  96. tries to  figure out  what you  are telling  it.  If  it doesn't
  97. understand, it  will tell  you right  when you  enter the  line!
  98. Often, it offers advice on how  to fix  mistakes.  This  is when
  99. you will like COMAL's insert, delete, and cursor  features.  You
  100. don't retype the entire line, just the corrections.
  101.  
  102. I can hear you saying, "Ok, COMAL is friendly,  but what  can it
  103. really do?"  The power of COMAL  comes from  its commands,  file
  104. handling ability, and program structures.
  105.  
  106. You have already seen the PRINT command. COMAL provides  several
  107. commands to deal with  numeric and  text data.  The data  can be
  108. provided  to  a  running  program  from  DATA statements  in the
  109. program, from a file stored on disk, or by the person using  the
  110. program.  COMAL supports all  the usual  math operators  such as
  111. addition, subtraction,  multiplication, and  division.  It  also
  112. knows  logarithms,  trig functions,  two methods  for generating
  113. random  numbers,  and a  lot more.   Text strings  may be  added
  114. together or have sub-strings  extracted from  them.  A  built-in
  115. string  search  even  tells  the position  of one  string within
  116. another if there is a match.  Comparison operators allow strings
  117. and numbers  to be  sorted.  Numbers  can be  converted to  text
  118. format, and back again.
  119.  
  120. COMAL supports two kinds of  data files.  SEQUENTIAL files  read
  121. data from start to finish.  You can write to sequential files or
  122. read from them, but  not both  at the  same time.  RANDOM ACCESS
  123. files are good if you store lots of  records together,  but only
  124. access a few at a time.   You can  read any  record, update  the
  125. information, and write it back.  You don't have to start  at the
  126. beginning of the file.
  127.  
  128. Normally, COMAL  uses  the  screen  for  all  its output.  But a
  129. special option  redirects PRINT  statements to  your printer  or
  130. even a disk file. You SELECT  the output  location.  Later,  you
  131. SELECT the screen again.
  132.  
  133. Easy  so  far!   But  it  is  COMAL's  structures  that simplify
  134. programming, and keep advanced users from  switching to  another
  135. language.   COMAL  has  four  loop  structures,  two conditional
  136. branching  structures,  named  procedures  and  functions   with
  137. parameters, and an error trapping structure.
  138.  
  139. The loop structures execute one  or more  consecutive statements
  140. over and over. Most loops have a one-line short form.
  141.  
  142. The REPEAT and WHILE loops are similar. Both loop  an indefinite
  143. number of times.  The difference is  when they  decide to  stop.
  144. The REPEAT loop places its test at  the end  of the  loop. Thus,
  145. the statements inside the loop will always be executed at  least
  146. once.  The WHILE loop places the  test at  the start,  so it  is
  147. possible to skip the statements inside altogether.
  148.  
  149. COMAL also  includes  the FOR  loop. It  counts from  a starting
  150. value to the terminating value. This not only  lets you  specify
  151. the exact  number of  times the  loop should  execute, but  also
  152. gives you a counter to use for other things.
  153.  
  154. The last loop structure is  LOOP. Like  REPEAT and  WHILE loops,
  155. the  statements  inside  are  executed an  indefinite number  of
  156. times. However, it's EXIT is from the middle, not the  ends, and
  157. you can specify exactly how many loops to take as an option.
  158.  
  159. The  conditional  structures  choose  one section  of code  over
  160. another, based on a comparison.  A multi-line  IF structure  has
  161. its  primary  test on  the first  line (optional  ELIF secondary
  162. tests are also allowed). If the test is true, its statements are
  163. executed. Otherwise, an ELSE section is executed (if you include
  164. it).  A one-line IF is also available.
  165.  
  166. The CASE structure evaluates one expression at the start (either
  167. a number or a text string). The value is compared to the  values
  168. in the WHEN statements.  If the main expression value matches  a
  169. value in a WHEN statement, the section of  code below  that WHEN
  170. statement is executed.  If  there is  no match,  the section  of
  171. code below the optional OTHERWISE statement is executed.
  172.  
  173. COMAL automatically indents lines within structures for you!  It
  174. also  capitalizes  keywords, and  puts variable  names in  lower
  175. case. This makes it easy to follow the program.
  176.  
  177. COMAL also allows  you to  store program  segments on  disk. You
  178. recall them into future programs using the MERGE command.  Lines
  179. are renumbered automatically to fit the new program.
  180.  
  181. COMAL is a powerful language. However, no  language can  include
  182. everything.  That's why COMAL includes the possibility to extend
  183. itself. You can write long routines, give them  names, and  call
  184. them with a single command, just like a PRINT statement.   These
  185. routines can be called from direct  mode or  a running  program.
  186. These are procedures and functions.
  187.  
  188. A procedure  is  usually  a  set  of  statements that  work well
  189. together. Information can be transferred to and from  procedures
  190. through variables called parameters.
  191.  
  192. Functions are like procedures -- multi-line structures which can
  193. have parameters, and are  called with  a single  statement.  The
  194. difference is that, unlike a procedure, a function also  returns
  195. a value (string or numeric) to the statement which called it.
  196.  
  197. Don't overlook  COMAL's  error  handling  structure. A  language
  198. which  permits  interaction with  a user  should anticipate  the
  199. possibility for errors which are difficult to resolve. A classic
  200. example  is  division  by  zero.   Many  languages give  you two
  201. choices: test every expression before it has a  chance to  cause
  202. an error, or let  the system  crash.  The  first method  has two
  203. drawbacks: it slows program execution, and the  test itself  may
  204. cause a crash.
  205.  
  206. COMAL gives you a  third choice  -- utilize  its Error  Handler!
  207. This structure can be used to  minimize the  effects of  errors.
  208. The Handler can't create the data in a missing file in the  case
  209. of a FILE NOT FOUND error, but it can give  you a  second chance
  210. to put  the correct  disk in  the disk  drive.  Since  the Error
  211. Handler is  a  true  structure,  it  is  easy to  use.  Advanced
  212. programmers can  utilize it  fully, complete  with nested  Error
  213. Handlers.
  214.  
  215. Finally, COMAL can be  extended and  expanded indefinitely  with
  216. "packages". Beginners can use packages without knowing how  they
  217. are  created.   Advanced  programmers  will  find   packages  an
  218. exciting way to tailor the COMAL system to their needs.
  219.  
  220. The above description is  not a  complete review  of COMAL,  but
  221. should  give  you  an  idea  of  what to  expect. All  COMAL 2.0
  222. implementations  are  compatible,  and  include these  features.
  223. Plus, each adds its own special characteristics (such  as mouse,
  224. windows  and  speech in  AmigaCOMAL). Trace  commands are  often
  225. included, to help follow program flow.
  226.  
  227. For a free copy of the 24 page COMAL INFO booklet,  send a  Self
  228. Addressed Stamped (45 cents) Envelope to:
  229.  
  230. COMAL Users Group USA Ltd
  231. 5501 Groveland Terrace
  232. Madison, WI 53716
  233.  
  234.  
  235. EOF
  236.