Question: Suppress printing of output in IF statements / loops / ...

Hello,

how do I suppress printing of output in case the colon does not do what it should? Example:

if condition then
  printlevel:=0:
  printf("Some info...");
  gArr:=Array(1..2,1..1):
  gArr[1,1]:=plot(sin,-1..1,axes=boxed,color=blue,title=`Title 1`):
  gArr[2,1]:=plot(cos,-1..1,axes=boxed,color=blue,title=`Title 2`):
  printlevel:=1:
  display(gArr);
else
  ERROR("Error message...");
end if;

If I put a colon after end if, only "Some info..." would be displayed without the graphs. If I leave the semicolon there, a horrendous amount of unnecessary stuff (like "printlevel:=0", empty array declaration, etc.) is printed.

If I could use simple plots without the array, it would be easy, I guess. However, the cells of the array are filled with plots according to many criteria (and array also makes the axes the same size). At the same time various info is displayed using printf(), so if I want the graphs to be at the end, I have to save the plots into something and then display them...

The colons at the end of the respective lines of code clearly do not do what they should. How do I suppres output in case of all the statements except printf() and display()?

Thanks for any help.

 

Best regards,

nvx

Please Wait...