userinfo - Maple Help

# Online Help

###### All Products    Maple    MapleSim

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

userinfo

print useful information to the user

 Calling Sequence userinfo(lev, fn, e1, e2 ... )

Parameters

 lev - non-negative integer fn - procedure name or set of procedure names e1 - any expression e2 - (optional) any expression

Description

 • The procedure userinfo is used in Maple procedures to print useful information to the user.
 • The first argument lev is a non-negative integer which determines the infolevel setting at which information will be printed.
 • The second argument fn is a procedure name or set of procedure names for which this information is to be printed. The information will be printed if the global assignment infolevel[fn] := Lev; or infolevel[all] := Lev; was entered before invoking the procedure containing the userinfo statement, and $\mathrm{lev}\le \mathrm{Lev}$.
 • It is possible to have the name for which the information is printed different from the name of the procedure in which this information is given.  This is useful when writing a set of routines that work together.  You can set the infolevel for a set of routines at the same time.
 • If the third argument is the symbol 'NoName', this argument will be discarded and no function name will be printed. Otherwise, the name of the invoked procedure is printed using lprint, followed by a colon and 3 spaces.
 • If the next argument is a string containing numbered parameters consisting of the percent symbol, "%, optionally followed by a minus sign, "-", followed by one or more digits making up an integer n, then this string is interpreted as a format string in which the evaluated remaining arguments are substituted.
 A numbered parameter of the form %n will display the nth remaining argument in lprint notation.
 A numbered parameter of the form %-n will display the nth remaining argument, assumed to be a Maple integer, in ordinal form. For example, the value 2 is displayed as "2nd".
 • If the first remaining argument is not a format string as described above, then all the remaining arguments are evaluated and lprinted together, each separated from its neighbours by 3 spaces.
 If an argument is of the form print(...) then that argument is prettyprinted.
 If an argument is of the form lprint(...) then that argument is lprinted on a separate line.
 • The user must assign a non-negative integer to some of the entries in the global table infolevel before invoking the procedure.   If the entry infolevel[all] is a non-negative integer then every userinfo call will print if its level is less than or equal to infolevel[all] .
 • Throughout the Maple library userinfo statements have been used with the following conventions:
 Level 1: reserved for information that the user must be told.
 Level 2,3: general information, including technique or algorithm being used.
 Level 4,5: more detailed information about how the problem is being solved
 • The item infolevel[hints] is initialized to a value 1. Maple sometimes returns unevaluated answers when it does not have enough information to produce an explicit answer (because, for example, such an answer would not be correct over all complex numbers). This facility is intended to report hints as to which further information, given through assume(), would enable Maple return an explicit answer.

Thread Safety

 • The userinfo command is thread-safe as of Maple 15.
 • For more information on thread safety, see index/threadsafe.

Examples

 > a1 := proc(x,y) userinfo(3,a1,entered with,x,y); x+y end proc:
 > ${\mathrm{infolevel}}_{\mathrm{a1}}≔3:$
 > $\mathrm{a1}\left(3,4\right)$
 a1:   entered with   3   4
 ${7}$ (1)

Use a different name for infolevel setting

 > a2 := proc(x,y) userinfo(3,myname,entered with,x,y); x-y end proc:
 > ${\mathrm{infolevel}}_{\mathrm{myname}}≔3:$
 > $\mathrm{a2}\left(5,2\right)$
 a2:   entered with   5   2
 ${3}$ (2)

 See Also

## Was this information helpful?

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