library(printlength)
library(printlength)
provides four predicates to determine how wide a
term would be if written:
print_length(
+Command,
-Length)
print_length/2
allows you to determine how many columns an atom
(or other term) would take if printed according to Command.
The length of the output of any command at all can be determined this
way, provided that it writes to the current stream, and not to a stream
argument. print_length/2
fails if Command fails.
print_length(
+Command,
?StartColumn,
?EndColumn)
line_position
as "the number
of characters that have already been read from/written on this line"),
so print_length/3
will fail if StartColumn is negative.
print_length/3
fails if Command fails.
print_lines
(+Command, -Lines)
print_length/2
.
tab_to(
+Column)
line_position(
Current_output,
Column)
is true
by writing 0 or 1 newlines and at most Column spaces to the
Current_output stream.