up previous next

Print, PrintLn

Syntax

Print E_1,...,E_n :NULL
Print(E_1,...,E_n):NULL

PrintLn E_1,...,E_n :NULL
PrintLn(E_1,...,E_n):NULL

where the E_i are CoCoA expressions.
    

Summary

print the value of an expression

Description

The command Print displays the value of each of the expressions, E_i. The parentheses are optional. The argument, NewLine, (without quotes, but note the two capital letters), moves the cursor to the next line.

The command PrintLn is equivalent to Print with a final extra argument, NewLine; in other words, it prints the values of its arguments, then moves the cursor to the next line. The parentheses are optional.

example

    
For I := 1 To 10 Do  
  Print(I^2, " ");
EndFor;
1 4 9 16 25 36 49 64 81 100 
-------------------------------
For I := 1 To 3 Do
  PrintLn(I);
EndFor;
1
2
3

-------------------------------
Print "hello",NewLine,"world";
hello
world
-------------------------------
        
    

See Also