TEXTWIDTH -- the maximum
number of characters in an output line
IntroductionThe environment variable TEXTWIDTH determines the
maximum number of characters in one line of screen output.
Call(s)
TEXTWIDTH
TEXTWIDTH := n
Parametersn |
- | a positive integer smaller than 2^31. The default value is 75. |
Related
Functions
DetailsTEXTWIDTH characters per line.delete TEXTWIDTH'' resets
TEXTWIDTH to its default value. Executing the function
reset also restores the
default value.TEXTWIDTH depends on the length
of the prompt string, which is defined via Pref::promptString: The minimal
value is 7 plus the length of the prompt string. The default prompt
string is ">> ", thus the minimal value of
TEXTWIDTH is 10 in this case.TEXTWIDTH is set to its maximum value 2^31 -
1 when printing to a text file using fprint. Thus, no additional line
breaks occur in the output.TEXTWIDTH does not influence the typesetting of
expressions which is available for some user interfaces of
MuPAD.TEXTWIDTH set to 63.
Example
1The maximal length of a line is set to 20 characters:
>> oldTEXTWIDTH := TEXTWIDTH: TEXTWIDTH := 20: 30!
2652528598121910586\
36308480000000
We restore the previous value:
>> TEXTWIDTH := oldTEXTWIDTH: 30!
265252859812191058636308480000000
Example
2The following procedure adds empty characters to produce output that is flushed right:
>> myprint := proc(x) local l; begin
if domtype(x) <> DOM_STRING then
x := expr2text(x);
end_if;
l := length(x);
print(Unquoted, _concat(" " $ TEXTWIDTH - l, x))
end_proc:
>> myprint("hello world"): myprint(30!): myprint("bye bye"):
hello world
265252859812191058636308480000000
bye bye
>> delete myprint: