echo, print, print line
The following functions compose the contents in the function parameters into one string and outputs them on the screen.
echo outputs the contents onto the screen, followed by new line. Indirect parameter passing is disabled, so sets provided
in the 1st function parameter will not be interpreted as individual function parameters but is considered as an actual set value.
print line works like echo, but indirect parameter passing is enabled. E.g. print({a,1}); is treated as print(a,1);.
print works like print line, but stays on the same line afterwards (no 'new line'.)
In addition of outputting the composed string onto the screen, it is available as return value, too.
Indirect parameter passing is disabled for function 'echo'.
Min 0
No. | Type | Description |
---|---|---|
1, ... input |
all types | Contents Contents to be output |
Type | Description |
---|---|
string | Composed string Same contents as output to the console |
c[] = 3+5*2;
a[] = echo( "Calculation: ", c[], " compared with 13 gives ", c[]==13, "." );
echo("Return value: ", a[] );
r[] = print("Note the line break ... " );
print(r[]); // Repeat
print ("in a[] at the end.");
echo;
echo;
s[] = { "Calculation: ", c[], " compared with 13 gives ", c[]==13, "." };
echo("Output set with 'echo':");
echo( s[] );
echo("Output set with 'print line':");
print line( s[] );
Calculation: 13 compared with 13 gives true.
Return value: Calculation: 13 compared with 13 gives true.
Note the line break ... Note the line break ... in a[] at the end.
Output set with 'echo':
{'Calculation: ',13,' compared with 13 gives ',true,'.'}
Output set with 'print line':
Calculation: 13 compared with 13 gives true.