Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ Overview1-4 System5-11 Matrix12-20 System22-28 I/O29-31 Translators37-48 System50-59 Linear algebra60-69 Eigen □ Equations □ 70-74 Algebraic75-79 Differential80-84 Quadrature85-95 Approx96-99 Probability100-105 Numerische Mathematik106-110 Graphing
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureAtlas manualsAlgol Library :: Atlas Algol Library
ACLLiteratureAtlas manualsAlgol Library :: Atlas Algol Library
ACL ACD C&A INF CCD CISD Archives
Further reading

Overview
1-4 System
5-11 Matrix
12-20 System
22-28 I/O
29-31 Translators
37-48 System
50-59 Linear algebra
60-69 Eigen
Equations
70-74 Algebraic
75-79 Differential
80-84 Quadrature
85-95 Approx
96-99 Probability
100-105 Numerische Mathematik
106-110 Graphing

ICT22

A more flexible format for the output of data can be obtained by using the KDF9 write procedure than any available in the standard ICT set of I/O procedures. This procedure has therefore been defined as ICT22.

            procedure write kdf9 (F, Q);
value F,Q;
integer F;
real Q;

This procedure outputs the quantity Q in a form which depends on the format F. The value of F must be set to the result of calling the function procedure:-

            integer procedure format(S);
string S;

The string S is set up as a pattern showing the form that the number should take on the output media.

Format Statement Syntax

<initial>spaces ::= <empty> | <unsigned integer> s| |s |ss | 
                     sss | ssss | sssss | ........ | sssssssssssssss 
<sign> ::= <empty>|-|+|≠ 
<exponent sign> ::= -|+|≠ 
<exponent layout> ::= 10<exponent sign> nd 
<terminator> ::= <empty> | ;
<editing symbols> ::= <empty> | c | cc | ccc | p 
<zeros> ::= 0 | <zeros> 0 | <zeros> s | s <zeros> 
<positions> ::= d | <positions> d | <positions> s | s <positions> 
<fractional layout> ::= .<positions> 
<floating layout> ::= d <fractional layout> 
<digit layout> ::= <positions> | <fractional layout>| 
                   <positions> <zeros> | <positions> . <zeros> | 
                   <positions> <fractional layout> <zeros> | 
                   <positions> <fractional layout> | 
                   <positions> <zeros>. <zeros> 
<decimal layout> ::= <digit layout> | n <digit layout> | s <decimal layout> 
<layout tail> ::= <decimal layout> <terminator> <editing symbol> | 
                  <floating layout> <exponent layout> 
                  <terminator> <editing symbol> 
<layout> ::= <initial spaces> <sign> <layout tail> 
<format identifier> ::= <identifier> 
<format statement> ::= <format identifier> := format ( '<layout>')

The layout

A different integer identifier is used for each format required. This identifier is then used as a parameter to a write kdf9 statement.

Tfle symbols of the layout give a picture of the digits, spaces and symbols as they will appear on the printed sheet. The finally printed number will have exactly the same number of printed characters as is present in the layout (except in the case of alarm printing and the characters c, p and the special case if initial spaces). The various symbols of the layout have the following significance:

Initial spaces
Initial spaces allow for up to 15 spaces to be left before the sign position, or where the sign should be.
Sign
The four possible symbols in the sign position signify the following:
Empty
The number is supposed to be positive. No sign will be printed. If a negative number is encountered, alarm printing will take place.
Minus
The sign position will always be printed using a space for positive and - for negative numbers.
+
Plus. The sign position will always be printed using a + for positive and - for negative numbers. For both + and - the sign moves to the right with the suppression of left hand zeros.
Not equals. The sign will always be printed in the position specified using + for positive and - for negative numbers.
Digits
Letters d and n represent digits. Letter n only appears as the first symbol following the sign, and its presence indicates left-hand zero suppression. The position immediately to the left of the decimal point, or where the decimal point would be, is never suppressed.
Zeros
Zeros may appear at the end of the deciamal layout and represent the field in which a number may be printed, to the total number of letters d and n significant figures.
Spaces
Letter s represents space and a space will be printed everywhere s occurs.
Decimal Point
The decimal point will be printed in the position specified.
Exponent
Exponent sign has the same effect as sign except that empty is not allowed. Exponent layout is then suffix ten followed by a sign and a 1 or 2 digit integer.
Terminator
A semi-colon may appear after the last digit or space in a number.
Editing Symbols
c or p may appear after the terminator position. c will output carriage return line feed and there may be up to three in number. p will output the page change representation. c and p, however may not appear together.
Round off
All numbers will be correctly rounded to the number of significant figures printed.
Limitations
The total number of symbols n, d, 0 and s in any decimal or floating layout must be ≤ 23. The total number of symbols n and d in any decimal or floating layout must be ≤ 12. This gives the number of significant figures.
Zero suppression
Left hand zero suppression replaces left-hand zeros by space characters. For plus and minus the sign position moves to the right so that the number of spaces between the sign position and the first unsuppressed digit remains constant.
Alarm printing

Alarm printing will occur when the number is too large for the layout or a negative number occurs with a layout having an empty sign position. Alarm printing will also occur if the format is syntactically incorrect. The number will be printed in standard floating format marked with an asterisk as follows:

*≠d.ddddsddddsddds ≠nddc

The alarm printed number will be on a new line followed by another new line with the appropriate number of spaces, so that the overall layout is not disturbed.

For example:-

   i := format ('≠ndd.d'); 
   write kdf9 (i, 37.28);

or alternatively

   write kdf9 (format ('≠ndd.d'), 37.28);

would output

   +37.3

ICT22 comprises the two procedures write kdf9 and format.

ICT23

This consists of the two procedures:-

            integer procedure char in kdf9;

procedure char out kdf9(C);
value C;
integer C;

The procedure char in kdf9 will read the next character of the selected data stream and the Atlas internal code value of this character will be the result of the procedure. For example reading the digit 1 gives the result 17 and A gives the result 33. The case shift causes 64 to be added to the internal code value. Reading a, for example, has the resulting value 97.

The procedure char out kdf9 will output to the selected output stream the character having internal code number C.

These two procedures are particularly useful for testing for the appearance of certain characters on the input and the output of unusual forms.

ICT24

            procedure copy text kdf9(S);
string S;

This procedure causes characters to be copied from the selected input to the selected output. If the string S consists of a single character then copying will take place from the current position of the input stream and will continue until the character in S is encountered. If the string S consists of two characters then all characters on the input preceding the appearance of the first character are ignored. Copying then takes place until the appearance of the second character in the string. The characters in S which indicate the start and finish of the text to be copied will not themselves be copied.

ICT25

            procedure read array kdf9(A, S);
real array A;
string S;

This procedure will read from the currently selected input an array A punched in the following form:

S;
w; d; m1; m2; m3;........md;
element; element; ........;element;

The symbols have the following significance:

If w = 1, the order in which the elements are expected from the tape is that given by first taking the lower bound values of the first (d-1) subscripts, and taking the dth subscript through its range from lower bound to upper bound; then stepping on the (d-1 )th subscript and taking the dth again through its range; and proceeding thus through the subscripts from right to left. In the case of a two-dimensional array regarded as a matrix, this is reading the elements by rows.

If w = -1, the subscripts are worked through from left to right. For a matrix this is reading the elements by columns. This is regarded as the usual form, rather than reading by rows.

d is the number of subscripts. (d = 2 for a matrix.)

mr is the range of the rth subscript.

ICT26

            procedure write array kdf9(F, D, A, S);
value F, D;
integer F, D;
real array A;
string S;

The array name S is output on the currently selected output followed by the initial parameters necessary for reading the array back in again using ICT25. Following this, the elements of the array are printed in columns.

ICT27

The library item ICT27 consists of the four Elliott procedures:- address, lowbound, range and size. These four procedures allow the user access to all the information in the array's dope vector. They can be used to generate efficient array handling in code procedures.

            integer procedure address(A);
array A;

The result of this procedure is the address of the first element of the array A.

            integer procedure lowbound(A, I);
value I;
array A;
integer I;

The result is set to the lower subscript bound for the Ith subscript position from the left in the array A.

            integer procedure range(A, I);
value I;
array A;
integer I;

The result is the number of array elements in the range of the Ith subscript position from the left in the array A.

            integer procedure size(A);
array A;

The result is the number of elements In the array A.

For example the address of the array element A[I,J] is:-

(I _- lowbound (A,1)) * range (A,2) + J - lowbound (A,2) + address (A)

ICT28

            procedure advance elliott;

This procedure advances the currently selected input stream over the next character.

            Boolean procedure buffer elliott(S);
string S;

The value of this Boolean function is true if the next character to be read on the currently selected input is the same as the single character defined as the string S; otherwise the result is false.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site