Although UniCOMAL is a DOS and OS/2 Development System, it runs well from MS-Windows, in a DOS Window in Windows 3.x and Windows 95/Windows NT. The files COMAL.ICO, COMAL87.ICO, COMAL.PIF and COMAL87.PIF, which are supplied with the Developers' version, can be used to help set up a suitable Windows Program Group.
If a file (either a .CML file, or a .LST file, or a .DSP file, for example) is dragged from File Manager (Windows 3.x) or from a directory window (Windows 95), into the UniCOMAL window, the path name of the file appears in the UniCOMAL window. One can then insert the command LOAD, ENTER or MERGE before the path name. In this way, one can use drag-and-drop methods to load files instead of having to type long path names, or having to navigate through the filing system using the CHDIR command.
Text cut or copied from text files containing line-numbered COMAL code (.LST files, for example) can be pasted into the UniCOMAL window from the clipboard, whereupon UniCOMAL accepts them as if the MERGE command had been used to insert them from DOS.
Text cut or copied from text files containing COMAL code without line numbers (.DSP files) can be pasted into the UniCOMAL window if the AUTO command is first issued in the UniCOMAL window. The COMAL lines are then appended to whatever code is currently in the editor, and numbered appropriately.
These methods are particularly useful with email and the Internet, since code can be copied from a browser screen or an email window, and pasted directly into a UniCOMAL window, without having to save the code first.
It is quite possible to launch more than one UniCOMAL window at a time. In this way, for example, one can have the program code visible in one window with the on-line help text visible in another, and can compare the two side-by-side. Alternatively, one could have the code for a MODULE loaded into one window, and the code for a program which USEs that module in another window. This allows one to work on both program and module code without having to reload either at any time.
It is also easy to set the system up so that a developing program can be edited in a "program window" and tested in a "run window". In what follows, imagine that a student has a folder, called "student", as a working or log-in directory, and has made a folder called "programs" for storing COMAL programs in. The student can do something like this:
This will produce a new UniCOMAL window with the "tables" code running in it, alongside (or overlapping) the window with the program code. In the event of a run-time error halting execution, the student can see the output prior to the error and the error message in the "run window", and can locate the offending section of code in the "program window", amend the code, save it again, then re-launch. This method also reinforces good programming practice, since the student is obliged to SAVE the amended code before testing it.
A slight drawback of this method is that, on a normal exit from the running program, the "run window" will usually collapse without giving the user time to examine the output. This could be prevented by ensuring the "close on exit" option in the UniCOMAL properties list (in Windows) is not selected, but that would, in its turn, lead to multple "run windows" being generated each time the code is launched, which would be confusing and might start to gobble memory. It might be better to leave the "close on exit" option selected, and instead to encourage students to finish programs with a "wait for keypress" call to a procedure like this:
PROC wait_for_keypress PRINT "Press a key to exit the program." WHILE NOT(ORD(INKEY$)) DO NULL ENDPROC wait_for_keypress
Under these conditions, the "run window" will remain open until the student presses a key, then collapse ready for another launch later.
Subject to some quite severe restrictions, it is possible to use UniComal to develop an application which will run in a window in MS-Windows V3.1, Windows 95 and Windows NT, and will appear to the user as if it were a (rather clumsy) Windows program.
What you do is write the program - using either text mode or graphicscreen modes 0, 1 or 2 (higher graphics modes are switched to full-screen operation by Windows, depending on the amount of memory on the video adapter), then compile it, using the COMALC compiler provided with UniCOMAL Developers' versions, as a standalone DOS program. This can then be run in a window in MS-Windows.
We are working on one or two such programs at the moment - see the BUTTONS module on the Downloads page for example.