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:
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:=4For 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.
Last modified on October 30, 2009.







