Previous Page Next Page Contents

userinfo -- print progress information

Introduction

userinfo(n, message) prints a message if an information level larger or equal to n is set via setuserinfo.

userinfo(n1..n2, message) prints a message if the information level set by setuserinfo is between n1 and n2.

Call(s)

userinfo( <Text,> n, message1, message2...)
userinfo( <Text,> n1..n2, message1, message2...)

Parameters

n, n1, n2 - the information levels: nonnegative integers
message1, message2... - arbitrary MuPAD objects. Typically, character strings.

Options

Text - do not separate the arguments by commas in the output

Returns

the void object of type DOM_NULL.

Side Effects

The formatting of the output of userinfo is sensitive to the environment variable TEXTWIDTH.

Related Functions

print, setuserinfo, warning

Details

Example 1

The function expr2text is useful for incorporating MuPAD objects in a text message:

>> f := proc(x)
        begin
          userinfo(2, "the argument is " . expr2text(x));
          x^2
        end_proc:
>> setuserinfo(f, 2, Name): f(12)
      Info: the argument is 12 [f]
      
                                    144
>> setuserinfo(f, 0): delete f:

Example 2

A call of the form userinfo(n, message) causes message to be displayed if the information level is at least as high as n. If you want message to be displayed only if the information level equals n, use a range that consists of one point only:

>> f := proc()
        begin
          userinfo(2..2, "Infolevel = 2");
          userinfo(2, "Infolevel >= 2");
        end_proc:
>> setuserinfo(f, 2): f():
      Info: Infolevel = 2
      Info: Infolevel >= 2
>> setuserinfo(f, 3): f():
      Info: Infolevel >= 2
>> setuserinfo(f, 0): delete f:

Example 3

By setting the information level of faclib to 5, we get information on the algorithms used for factorization:

>> setuserinfo(faclib, 5): factor(x^2 + 2*x + 1)
      Info: faclib::monomial called with poly(x^2 + 2*x + 1, [x])
      Info: Squarefree factorization (Yun's algorithm) called
      
                                        2
                                 (x + 1)
>> setuserinfo(faclib, 0):

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000