next up previous
Next: Handling the programmes Up: Astronomic and other programmes (written in Pascal) Previous: Using computers with MS-DOS

Development of programmes (remarks for Pascal users)

The programmes are used on PCs, and are written in the Borland Turbo Pascal language. We use version 6.0 of the language, but no its new features with respect to some previous versions. Thanks to the existence of Free Pascal Compiler, they can now be developed not only in MS-DOS, but also in Linux or even in some still popular commercial systems.

The programmes have been developed gradually, according to my needs and possibilities. Included are also similarly developed programmes of my colleagues, who agree with their spreading under the same GNU General Public License [2]. We have used mostly algorithms from a booklet by Zdeněk Pokorný [5] (who himself used the book by Jan Meeus [6]) and from text by Jana Vondrák in [7].

As the programmes became more complicated, or as the author could not remember algorithms of old programmes, a need for some documentation emerged, at least in the form of comments in the source codes. In spite of that, the comments remained mostly quite insufficient, and the programmes are very far from the ideal of literate programming, as formulated and made true by Donald Knuth (author of programmes like WEB and [15]). Further, the programmes have been supplemented to behave well, like (e.g.) programmes of MS-DOS which explain their meaning and use when being started a suitable way. These instructions how to use the programme are contained at the beginning of its text.

Some time ago, I have noticed two problems of Borland Turbo Pascal when run with or without numeric co-processor. The first one concerns different ways of rounding. Pascal itself rounds real numbers ending .5 to a greater absolute value, whereas numeric co-processor to an even number. I have changed in some programmes the rounding procedure to a third possibility, namely always to a greater value (by a function RoundUp). The second problem concerns formatting. With co-processor, all unformatted real numbers are output as extended, with e.g. four digits in exponent. Some formatting procedures at the beginning of str_num unit overcome different behaviour of different hardware.

The programmes are English-written, with few exceptions. Why is that so, when most of the users are speaking Czech? The main reason is, that the author hates disabled Czech without diacritics, and that Czech diacritics has not just one possibility how to be implemented in the computers. The problem of two main MS-DOS-based ``code pages'' can be solved by the programme CS_Conv. But the English programmes are easier to read, when names of variables, subroutines and comments are English as well as the programming language. And each potential user of these programmes surely reads English, with some effort at least.

If you make some programme better, and you suppose, that your adaptation may suit another people as well, please give them whole this package including your addition. I welcome you sending the modified programme me as well. I will gladly discard the original work and replace it by the same-named version by you in our set.

As follows from the License [2], everybody can modify the programmes and use their parts in her/his own programmes. If such programmes are spread further, they are obliged to remain free software subject to the same Public License.

If the change of a programme concerns only

the programme can keep its name and no notice on the change is needed. The same holds in case, when just explanations are supplemented (it may be needed in some cases, to make the use of the programme understandable to another people than to author himself).


next up previous
Next: Handling the programmes Up: Astronomic and other programmes (written in Pascal) Previous: Using computers with MS-DOS
hollan@ped.muni.cz (english / česky, raději než ,,cesky``)