Transput of structures

The following program fragment will print the details of the name emp declared in section 7.5:

   print((emp,newline))

For details of how this works, see the remarks on “straightening” in section 9.2. However, the individual strings would be printed together and so, in this case, it would be better to write the following:

   print((name OF emp,newline));
   FOR i TO UPB address OF emp
   DO
      print((address OF emp)[i],newline))
   OD;
   print((dept OF emp,newline,
          ni code OF emp,newline,
          tax code OF emp,
          basic OF emp,
          overtime OF emp,
          net pay OF emp,
          tax OF emp,newline))

In practice, it would be sensible to declare a procedure or an operator which would print the structure and then call it as required.


Sian Mountbatten 2012-01-19