next up previous contents
Next: Basic commands Up: Simple exercises in MAGMA Previous: MAGMA functions and procedures   Contents

Printing

There is no ``print file'' option (as far as I know) which sents the output of the MAGMA session to a printer attached to the computer. To do that, you must log the session using SetLogFile and then print out that file using some other program. There is a PrintFile command which prints the output to a file.

To have MAGMA print out a string or some variable values to the screen, use the print command. For example,

> a:=3;
> b:=5;
> print "a is equal to ",a,"\n","b equals  ",b;
a is equal to  3
 b equals   5

Note the \n is the newline character.

Exercise 16   write a for loop over $i=1,...,10$ which prints out, on separate lines for each $i$, the pair $(i,i^2)$.



David Joyner 2001-08-22