set or query user interface variables - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Resource Management : interface

interface - set or query user interface variables

Calling Sequence

interface(arg1, arg2, ... )

Parameters

argN

-

either of the form name=val or simply name

Description

• 

For information on the Maple worksheet interface, see Maple Versions.

• 

The interface command serves as a mechanism of communication with the user interface. Specifically, this command is used to set and query all variables that affect the format of the output, but do not affect the computation.

• 

Note that some interface options will be affected by the restart command. The interface options will be reset after the restart command is issued. For details, see restart.

• 

If an argument has the form name=val, then this specifies the setting for the variable name. The interface command returns the old value of the variable name.

  

If an argument is simply a name, then Maple returns the current value of the variable name.

  

If a sequence of arguments is given, Maple sets the variable for any arguments of the form name=val and returns a sequence of values (according to the above descriptions) corresponding to the sequence of arguments.

• 

The list of names is:

ansi

autoassign

contextmenusize

displayprecision

display_zero_complex_part

echo

elisiondigitsafter

elisiondigitsbefore

elisiondigitsthreshold

elisiontermsafter

elisiontermsbefore

elisiontermsthreshold

errorbreak

errorcursor

helpbrowser

historyfile

historysize

imaginaryunit

indentamount

labeling

labelwidth

latexwidth

longdelim

max_record_depth

patchlevel

plotdevice

plotoptions

plotoutput

postplot

preplot

prettyprint

printbytes

prompt

quiet

rtablesize

screenheight

screenwidth

showassumed

typesetting

verboseproc

version

warnlevel

worksheetdir

 

 

• 

The interface variables, values, and description are given in the following table.

Name

Values

Explanation

Default

 

 

 

 

ansi

true or false

For the Command-line interface, tells the pretty printer to use ANSI escape sequences to highlight Maple keywords.

false (Windows); true (UNIX)

 

 

 

 

autoassign

true, false, or <name>

For the Classic interface, tells the graphical user interface to automatically assign results to new names when using context-sensitive menus, and to reuse those names when constructing subsequent commands.  The default root name R can be changed to T (for example) by a command of the form interface('autoassign' = T).

R

 

 

 

 

contextmenusize

automatic, standard, or condensed

Sets the configuration of the context menu for a math expression. By default, Maple selects the best configuration for the screen size.

automatic

 

 

 

 

displayprecision

-1 or integer 0..100

Controls the number of decimal places to be displayed. The default value is 1, representing full precision as determined by the Digits environment variable. This allows simplification of display without introducing round-off error.

-1

 

 

 

 

display_zero_

boolean

When set to false complex numbers of the

true

complex_part

 

form a+0*I are displayed without the 0*I part.

 

 

 

 

 

echo

0, 1, 2,

0 - Do not echo under any circumstance.

1

 

3, or 4

1 - Echo whenever the input or the output is not from or to the terminal, but do not echo as a result of a read statement (the default).

 

 

 

2 - Echo whenever the input or the output is not from or to the terminal.

 

 

 

3 - Echo only as a result of a read statement.

 

 

 

4 - Echo everything.

 

 

 

The echo option is superseded by quiet, so if quiet=true, no echo will occur.

 

 

 

 

 

elisiondigitsafter

positive integer

Sets the number of digits displayed in the tail of the expression. The tail follows the hidden middle elements, which are enclosed in square brackets. (Standard interface only.)

100

 

 

 

 

elisiondigitsbefore

positive integer

Sets the number of digits displayed in the head of the expression. The head precedes the hidden middle elements, which are enclosed in square brackets. (Standard interface only.)

100

 

 

 

 

elisiondigitsthreshold

positive

Specifies the number of digits at which

10000

elisionthreshold

integer or infinity

elision is applied. Infinity indicates that elision is off. Elision limits the number of digits of an expression that display in the worksheet. (Standard interface only.) To control the number of leading and trailing digits displayed, use elisiondigitsbefore and elisiondigitsafter. To control the maximum number of terms displayed, use elisiontermsthreshold.

 

 

 

 

 

elisiontermsafter

positive integer

Sets the number of terms displayed in the tail of the expression. The tail follows the hidden middle elements, which are enclosed in square brackets.  (Standard interface only.)

100

 

 

 

 

elisiontermsbefore

positive integer

Sets the number of terms displayed in the head of the expression. The head precedes the hidden middle elements, which are enclosed in square brackets.  (Standard interface only.)

100

 

 

 

 

elisiontermsthreshold

positive

Specifies the number of terms at which

1000

termelisionthreshold

integer

elision is applied. Infinity indicates that elision is off. Term elision limits the number of terms of an expression that display in the worksheet. (Standard interface only.) To control the number of leading and trailing terms displayed, use elisiontermsbefore and elisiontermsafter. To control the maximum number of digits displayed, use elisiondigitsthreshold.

 

 

 

 

 

errorbreak

0, 1, or 2

0 - do not break on error (pre-Maple VR2 mode).

1

 

 

1 - stop reading on syntax error.

 

 

 

2 - stop reading on ANY error.

 

 

 

See the details on errorbeak settings below for more detailed information.

 

 

 

 

 

errorcursor

true or false

For the Command-line interface, tells Maple to place the cursor on the location of a syntax error (if true), or to indicate the location with a pointer (if false).

true

 

 

 

 

helpbrowser

standard or text

Specifies the browser to use for viewing help when using the Command-line or Classic interfaces of Maple.  When set to "standard", help pages will be displayed in the standard gui's help browser.  When set to "text", help pages will be displayed as a stream of text.

standard (Classic); text (Command-line)

 

 

 

 

historyfile

name or string

Specifies the file to be used for persistent command-line history.  If the specified name is default, then history is written to the file .maple_history in the user's home directory.  If the specified name is none, then persistent command-line history is disabled.

default

 

 

 

 

historysize

integer

Specifies the number of lines of command-line history to retain.

1000

 

 

 

 

imaginaryunit

symbol

Specifies the symbol to be used to input the imaginary unit.  By default, this is I.  Any occurrences of the specified symbol in Maple input will be converted internally to Complex(1).  Any complex numbers displayed in Maple output will be displayed as specified by imaginaryunit.  The specified symbol must be a simple symbol that does not require left single quotes.  For example, I and _i are valid, whereas `complex/sqrtm1` is not.

I

 

 

 

 

indentamount

integer

The number of spaces items are indented if they must be broken across lines. This is also used in formatting procedures.

4

 

 

 

 

labeling

true or

This flag enables the use of the %1, %2,

true

labelling

false

... labels for sub-expressions on output.

 

 

 

This feature is only available for some output formats (Character and Typeset Notation). In particular, it is not available for editable math output (2-D Math Notation). It defaults to true.

 

 

 

 

 

labelwidth

positive integer

An item must be at least this many characters long to be considered for a %n label.  The measurement used is approximate.

20

 

 

 

 

latexwidth

float

Used by the LaTeX filter mode of Maple. Specifies the width, in inches, of generated LaTeX output.

5.0

 

 

 

 

longdelim

true or false

If true, Maple control structures such as if, do, proc, and so on are displayed with the newer-style long ending delimiters such as end if, end do, end proc, and so on. If false, ending delimiters are displayed as fi, od, end, and so on.

true

 

 

 

 

max_record_depth

integer

The maximum depth of nested Records that are displayed. (Standard interface only.)

1

 

 

 

 

patchlevel

integer

Normally zero, this read-only variable indicates that a patch library from Maplesoft has been installed to correct errors found after the product was released. The value returned is the patch number.

0

 

 

 

 

plotdevice

symbol

The name of the plotting device.

inline

 

 

For a list of known devices, see plot/device.

 

 

 

 

 

plotoptions

string

A string containing device-specific options to be passed to the device driver.  For more information, see plotsetup and plot/device.

empty string

 

 

 

 

plotoutput

string

The name of a file where the plot output will be stored.  See plotsetup.

"terminal"

 

 

 

 

postplot

list(integer)

A list of integers that encode the sequence to be sent after a plot is made to restore the output device.  Negative values specify a delay.  For values, see plotsetup.

empty list

 

 

 

 

preplot

list(integer)

A list of integers that encode the sequence to be sent before a plot to initialize the output device.  Negative values specify a delay.  For values, see plotsetup.

empty list

 

 

 

 

prettyprint

0, 1, 2, or 3

The variable that controls the method used to render Maple expressions in the user interface.  Value 0 uses lprint; value 1 uses a two-dimensional, character-based formatter; and higher values use platform-specific rendering methods. In the worksheet interface, values of 2 and 3 use typeset math. Note: Subexpression labeling is on, by default, for prettyprint=2, and off, by default, for prettyprint=3. For historical reasons, prettyprint can also be set to the Boolean values true or false.

3 (in Worksheet interface); 1 (in Command-line interface)

 

 

 

 

printbytes

true or false

Print the "bytes used.." message after every garbage collection (Command-line interface).

true

 

 

 

 

prompt

string or symbol

The string that is printed when user input is expected.

"> "

 

 

 

 

quiet

true or false

An interface constant that will suppress all auxiliary printing (logo, garbage collection messages, bytes used messages, and prompt).

false

 

 

 

 

rtablesize

integer between 0..2147483647 or infinity

The largest-sized rtable (Array, Matrix, or Vector) that will be displayed inline. Any rtable of more than two dimensions, or with any dimension larger than rtablesize, will be displayed as a placeholder.  Setting rtablesize to 0 will cause all rtables to be displayed as placeholders.  A setting of infinity will cause all one- or two-dimensional rtables to be displayed inline. Note: In the Command-line interface, the default value is 25.

10 (in Worksheet interface); 25 (in Command-line interface)

 

 

 

 

screenheight

integer

The height of the screen in characters.

25

 

 

 

 

screenwidth

integer

The width of the screen in characters. Must be greater than ten.

79

 

 

Note: The screenheight and screenwidth variables are valid but not meaningful for worksheet interfaces of Maple.  For example, the screenheight and screenwidth options have nothing to do with the displayed size of a worksheet. However, some things, like the output of the latex or dismantle commands, are affected by changing them. The character plot driver is also affected.  In the Command-line interface, the screenheight and screenwidth interface variables are updated automatically when a change in the size of the terminal in which it is running occurs. This does not happen when you change the size of a window in the worksheet. However, you can set them manually in the worksheet interface. If you do not change them, the defaults are used (25 lines and 79 columns).

 

 

 

 

 

showassumed

0, 1, or 2

Indicates how variables with assumptions are displayed.  A setting of 0 hides assumptions.  A setting of 1 causes variables with assumptions to be displayed with a trailing tilde. A setting of 2 causes a list of assumed variables to be displayed at the end of the expression.

1

 

 

 

 

typesetting

standard or extended

For the Standard interface, specifies which typesetting rules are used to display mathematical expressions. Standard typesetting uses default rules for displaying expressions (excluding modules, procedures, and procedural constructs). Extended typesetting uses a customizable set of rules for displaying expressions. To specify rules, use the Typesetting Assistant. To launch the Assistant, from the View menu, select Typesetting Rules, or run Typesetting[RuleAssistant](). For details, see Typesetting[RuleAssistant].

standard

 

 

 

 

verboseproc

0, 1, 2, or 3

0 - Do not print the body of a procedure; print only a skeleton of the form proc(x) ... end.

1

 

 

1 - Print the body of user-defined procedures, but do not print the body of Maple library procedures (the default).

 

 

 

2 - Print the body of all procedures.

 

 

 

3 - Print the body and remember tables of all procedures. Note that verboseproc has no effect when prettyprint is 0.

 

 

 

 

 

version

string

Provides interface version, release, platform, build date, and build ID information. For details on querying version information, see the version help topic. This interface variable is read-only.

not settable

 

 

 

 

warnlevel

0, 1, 2, 3, or 4

0 - Suppress all warnings.

3

 

 

1 - Print only library-generated warnings.

 

 

 

2 - Print library- and kernel-generated warnings.

 

 

 

3 - Print library-, kernel-, and parser-generated warnings (the default).

 

 

 

4 - Print library-, kernel-, parser-generated, and compatibility warnings (that is, all warnings).

 

 

 

 

 

worksheetdir

string

The path to the directory of the active worksheet file.  Unlike currentdir, this cannot be set.  For a file that is not yet saved, the value will be the same as currentdir(). (Standard interface only.)

not settable

 

 

 

 

• 

Details on errorbreak settings:

• 

interface(errorbreak=0)

  

When reading from the user, reading and processing continues after any error.

  

When reading a redirected file from stdin (UNIX), reading and processing of the file continues after any error.

  

When reading from a file through the "read" command, reading and processing of the file continues after any error.

• 

interface(errorbreak=1)

  

When reading from the user, reading and processing continues after any error.

  

When reading a redirected file from stdin, reading and processing of the file continues after any computation error, but stops after any syntax error.

  

When reading from a file through the "read" command, reading and processing of the file continues after any computation error, but stops after any syntax error.

• 

interface(errorbreak=2)

  

When reading from the user, reading and processing continues after any error.

  

When reading a redirected file from stdin, reading and processing of the file stops after any error.

  

When reading from a file through the "read" command, reading and processing of the file stops after any error.

• 

For all of the above:

  

Whenever reading and processing of a "read" file stops, the stack of all currently active "read" commands is unwound. In other words, reading and processing of all "read" files stops. For each file that is aborted, an error message  is generated that gives the file's name. This way, you know at which level in your nested reads the error actually occurred.

  

Whenever a stack of "read"s unwinds, processing continues, with the next command being read from either the user, or from a redirected input file. In other words, an error in a "read" file will not stop processing of a redirected input file (and of course, no normal error will stop processing of user input).

• 

In the Standard interface, you can also control many interface options using the Options dialog. For more information, see worksheet/managing/preferences.

Examples

Find out what plot device you are using.

mydevice:=interfaceplotdevice

mydevice:=inline

(1)

Generate Postscript output in a file. Note: The interface command returns the previous value assigned to a name, not the newly assigned value.

interfaceplotdevice&equals;postscript&comma;plotoutput&equals;myfile

inline&comma;terminal

(2)

Reset the plot device to inline.

interfaceplotdevice&equals;mydevice

ps

(3)

Store the current value of quiet and set it to true.

oldquiet:=interfacequiet&equals;true

oldquiet:=false

(4)

Look at the Maple code in library routines.

eval`type/Matrix`

procM...end proc

(5)

interfaceverboseproc&equals;2

1

(6)

eval`type/Matrix`

procMoptionCopyright (c) 1998 Waterloo Maple Inc. All rights reserved.&semi;localopts&semi;opts:=opmapx&rarr;iftypex&comma;identical&apos;shape&apos;&equals;anythingtheniftyperhsx&comma;&apos;list&apos;&comma;oprhsx&comma;rhsxelsexend if&comma;args&lsqb;2..&minus;1&rsqb;&semi;op0&comma;M&equals;&apos;Matrix&apos;andtypeM&comma;&apos;rtable&apos;optsend proc

(7)

evalf&pi;

3.141592654

(8)

interfacedisplayprecision&equals;5

1

(9)

evalf&pi;

3.141592654

(10)

100

314.1592654

(11)

interfacedisplayprecision&equals;1

5

(12)

Digits:=5

Digits:=5

(13)

evalf13

0.33333

(14)

3

0.99999

(15)

interfacedisplayprecision&equals;5

1

(16)

Digits:=20

Digits:=20

(17)

evalf13

0.33333333333333333333

(18)

3

0.99999999999999999999

(19)

The following examples demonstrate the elision options. These options are for the Standard interface only.  You can also control these options using the Options dialog. For more information, see worksheet/managing/preferences.

52104

29130486520243894529623053895593834890786414833841548364617732063716754081481379078028552440792926355704746836652054508584597185528433952366101529418011123632967861702261909487616

(20)

Set the elision threshold and the digits before and after.

interfaceelisionthreshold&equals;100&colon;

interfaceelisiondigitsbefore&equals;10&colon;

interfaceelisiondigitsafter&equals;15&colon;

52104

29130486520243894529623053895593834890786414833841548364617732063716754081481379078028552440792926355704746836652054508584597185528433952366101529418011123632967861702261909487616

(21)

See Also

Digits, Maple Versions, plot, plot/device, plotsetup, restart, Typesetting[RuleAssistant], worksheet, worksheet/managing/preferences


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam