printlevel - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Debugging : printlevel

printlevel

display of information; debugging procedures

 

Calling Sequence

Parameters

Description

Calling Sequence

printlevel := n

Parameters

n

-

integer

Description

• 

Statements within a particular procedure (or in the main session) are recognized in levels, determined by the nesting of conditional or repetition statements and the nesting of procedures.

• 

The top (interactive) level is level 0; statements within conditional/repetition statements are level 1, or level 2 if doubly nested, et cetera. The first procedure is level 5; statements within conditional/repetition statements within a procedure are level 6, et cetera. The nth nested procedure is level 5n.

• 

The setting of the printlevel environment variable causes the display of the results of all statements executed up to the level indicated by printlevel. Initially, printlevel is set to 1.

• 

Higher values of printlevel will cause more information to be displayed; negative values will cause no information to be displayed.

• 

When execution errors are encountered and 2<printlevel a summary of calling routines, such as provided by tracelast, is also provided.

• 

If an attempt is made to assign a non-integer to printlevel, an error is generated and the value of printlevel is not changed.

• 

For debugging purposes, printlevel := 1000 is not uncommon.

• 

For more comprehensive debugging facilities, see debugger.

• 

The display of assignments can be controlled by three kernelopts options, traceincidentalassign, tracesplitmulassign, and traceshowspecassign.

  

By default, assignments that occur as side-effects of calls to Maple built-in functions, such as assign or the 3-argument form of member, are shown during tracing. Setting kernelopts(traceincidentalassign=false) will suppress the display of such incidental assignments.

  

Setting kernelopts(tracesplitmulassign=true) will cause multiple assignments (for example, a,b := c,d;) to be displayed individually. For multiple assignments of many variables, or with complicated right hand sides, this is often easier to read.

  

Setting kernelopts(traceshowspecassign=true) causes some assignments to display in a distinctive way:

• 

Operator assignments that don't actually take place (for example, the second assignment in a := false; a and= b;) will be displayed using the symbol &:= instead of :=.

• 

Some assignments do not actually assign to the variable on the left hand side of the assignment statement, but instead assign into the value that the variable currently has. For example, if the value of A is an Array, then the assignment A[2] := x; or the operator assignment A ,= y assign into the Array, but A itself is not changed (that is, A continues to refer to the same, now modified, Array or table). Such assignments are then displayed using the symbol &[]= instead of :=.

• 

Except as described otherwise above, operator assignments such as x += y; are displayed as x := finalValue, where finalValue refers to the value that was assigned to x (x + y in this case).

See Also

debugger

environment variables

mint

trace

tracelast