Skip to content
Darren Bane edited this page Apr 2, 2018 · 4 revisions

OpenComal Quick Start Tutorial

(Tá leagan Gaeilge den leathanach seo ar fáil.)

I am: Jos Visser josv@osp.nl
Date: Sun Sep 8 10:17:20 CEST 2002

  1. If you are lucky, you have picked up a distribution with the opencomal binaries compiled and ready to run. If not, first consult BUILD on how to compile OpenComal. Then, after compiling, return here.

  2. OpenComal uses the Latin-9 character encoding internally, but the rest of the world has settled on UTF-8. The optimal setup is where LANG is set to a UTF-8 locale like ga_IE.utf8 (Linux) or en_GB.UTF-8 (macOS); and a ga_IE@euro (Linux) or en_GB.ISO8859-15 (macOS) locale also exists on the system. This should allow the entry and storage of accented characters.

    Unfortunately, there is a "feature" where this only works for locales that have a '.' decimal point separator, breaking da_DK which I was interested in for nostalgia purposes :-)

    You can get Linux (at least Debian) to generate new locale setup files by editing /etc/locale.gen and running "sudo locale-gen". I don't know of anything similar for macOS.

  3. OpenComal can optionally use different languages for output messages. Setting the LANG environment variable as above should be all that is required on Linux. You'll also need to set NLSPATH to something like "/usr/share/locale/%L/%N:/usr/share/locale/%L/LC_MESSAGES/%N:PREFIX/locale/%L/%N", replacing PREFIX with whatever you supplied to "make install". On macOS you may also need to specify a command-line argument, e.g. "-m opencomal_ga.cat". You can define an alias for this by adding "alias opencomal='opencomal -m opencomal_ga.cat'" to your $ENV file.

    Note that this feature is completely optional and the fallback is to traditional English messages.

  4. Start OpenComal ('opencomal' binary). The screen clears and something like the following appears:

    OpenComal -- A COMAL implementation
                 (c) Copyright 1992-2002  Jos Visser <josv@osp.nl>
    
    Warning: This is a Beta/Preliminary version! Please check the documentation
    
    $
    
  5. Congratulations. You just started OpenComal!

  6. Enter the following command:

    $ auto
    

    You can now enter your first OpenComal program. The line numbers appear automagically :-)

  7. Enter the following program:

    10 for f=1 to 10
    20 print f
    30 next
    40 print "OpenComal rules!"
    50 delay 5
    60 ^C
    

    You quit program enter mode using Ctrl+C.

  8. Now give the 'list' command. The output looks like this:

    10 FOR f:=1 TO 10 DO
    20   PRINT f
    30 ENDFOR
    40 PRINT "OpenComal rules!"
    50 DELAY 5
    
  9. Now 'run' the program... Did it do what you expected?

  10. Save the program:

    $ save "first.cml"
    
  11. And now exit the interpreter with the 'bye' command.

  12. And finally, run the program with the 'opencomalrun' runtime-only program:

    opencomalrun first.cml
    
  13. Now read OpenCOMAL...

Clone this wiki locally