WebCOMAL - A Scoreboard Example

This is a programming example involving both WebCOMAL and HTML frames Before tackling this section, you should have worked through the first article on WebCOMAL, webcomal.html and be able to run a COMAL weblet on your system. You should also review the webframe.html file on using html frames with WebCOMAL. This example is more elaborate than any of the previous ones and includes html "radio buttons" for input and the use of a small sequential data file to hold information between calls to the COMAL weblet.

The example arises from a programming project used with 16-year olds in Scottish high schools, called "Electronic Scoreboard". In this project, students are asked to develop a display scoreboard for an Association Football (Soccer) match. The scoreboard has to be able to display not just the score, but also a text message selected from a range of pre-programmed messages. The inputs are to be made by single keypresses on the scoreboard controller's keyboard, and the display has to be attractive, using either graphics or flashing/coloured text.

The problem with the above project, in COMAL, is not so much controlling the display, but rather making it look even a little like a professional one, such as students might see in a real football stadium. UniCOMAL is restricted to VGA graphics, and even with this poor provision, students have little time to develop skills with the Graphics module while they are struggling with programming concepts needed to control the display. We decided to try to use WebCOMAL to produce a response to the project specification which would produce an attractive display. To avoid providing students with a shrink-wrapped solution to this problem, however, we have chosen Rugby Union Football instead, the scoring system for which is much more complex than for soccer. Here is a screenshot of an early stage in a run of the program:

We are grateful to the Scottish Rugby Union website for their year 2000 Calcutta Cup screen background, which we have used to make the output more visually interesting.

We chose to put the control bar for the scoreboard into the same browser window as the scoreboard itself, using HTML frames to do so. In a real situation, the scoreboard portion of the window would be relayed to the stadium main screen, while the display shown above might be visible on a monitor on the stadium control room.

The Project Files

WebCOMAL solutions to problems need lots of co-operating files, rather than a single large program file as would be usual with simple COMAL. We used several files of different types in this project. They were stored in a project folder called "WebMessB", inside the C:\COMAL directory. Here is the complete list:

FilePurpose
index.html Sets up the frames for the main window display
control.html Sets up the Control Bar and calls the main COMAL weblet
display.html Sets up the display frame and inputs team names
score.seq A small sequential data file holding the team names and scores
control.cml The main COMAL weblet which processes the inputs and generates and updates the display.
setup.cml A small COMAL weblet which initialises names and scores and stores them in "score.seq"
rugby.gif A rugby ball, drawn with MS-Paint and converted to a GIF with Paint Shop Pro
rugby.jpg The SRU's Calcutta Cup wallpaper file
scot-flag1.gif A wavy Scottish flag.

The Development Tools used

We used a variety of simple development tools in this little project. The HTML files were edited using just MS-Notepad; the GIF files were edited using MS-Paint and JASC's PaintShop Pro V5.0; the CML files were produced with UniCOMAL V3.11 (we used Developers', but the Students' version would have done just as well) together with the Internet module. Testing was done using MS-Internet Explorer 5 to display the files, and the ComalServlet JAVA program to interface the browser to the rest of the project.

Try it yourself

We've put the whole project into a download file on the downloads page. You'll also need the WebCOMAL project pack, which you can also find on the downloads page, and the JAVA runtime environment.



Updated 7 May 2000