Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

Why won't Maple display the output of a command, even though I've ended it with a semicolon?

In the following example, the k term does not print, even though the statement k:=i^2 has a semicolon at the end, which should cause Maple to display the output on the screen:

> for i from 1 to 4 do > j:=i; > if j<2 then k:=i^2; fi; > od; j:=1 j:=2 j:=3 j:=4

The problem illustrated in the above example occurs because statements within a procedure are recognized in levels, determined by the nesting of conditional or repetition statements and the nesting of procedures. Thus, the semicolon does not necessarily imply that the expression will be displayed on the screen.

In order to display more information, increase the printlevel. The top (interactive) level is 0; statements within conditional/repetition statements are level 1, or level 2 if doubly nested. Higher values for printlevels will result in more information being displayed.

For the above example, if you increase the printlevel, you will then see the desired output:

> printlevel := 2; printlevel := 2 > for i from 1 to 4 do > j:=i; > if j<2 then k:=i^2; fi; > od; j:=1 k:=1 j:=2 j:=3 j:=4

For more about Maple, see Maple at IU.

For more information about statistical and mathematical software, email the UITS Stat/Math Center, visit the center's web page, or phone 812-855-4724 (IUB) or 317-278-4740 (IUPUI). The center is located in Bloomington at 410 N. Park Avenue, and is open for consultation by appointment Monday-Friday 9am-5pm.

This is document afcr in domain all.
Last modified on October 30, 2009.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.