Table from procedure

herclau's picture

Hello everybody, I'd like to write from a procedure results in a table as output. Something like this, that I show at the end.

 

Comments

Robert Israel's picture

Like what?

It really would help if you showed us an example of what you'd like as output.

herclau's picture

Table from procedure

I want to perform a procedure where it perform all the calculations that I have implemented in this sheet. And as output desire a table of analysis of variance and confidence interval. The table would like me to take the format on this sheet.
Best regards,
HermesView 9494_confidence interval.mw on MapleNet or Download 9494_confidence interval.mw
View file details

Doug Meade's picture

Embedded components to update a table

I know of no way to have a Maple procedure return a "table" that looks like what appears at the end of your worksheet. This is a GUI table, not to be confused with a table data structure within Maple.

What you can do is the following.

  1. Create the table like you have already done.
  2. Now, replace the numerical values with a Text Area embedded component. (Right-click on the component and select Component Properties. Set the width to, say, 15 and the rows to 1. Note the Name - or change it to something meaningful to you. You will probably want to unclick Editable. You won't be able to set the background to blend in with the rest of the table.)
  3. Next, write a procedure that computes the values that need to be displayed in this table. Instead of returning these values, your procedure will update the components you created in the previous step. The generic way in which you will do this is:
use DocumentTools in
  Do( TextArea0 = computed_value0 );
  Do( TextArea1 = computed_value1 );
  ...
end use;

To call the procedure to update the table, I might suggest putting a Button component next to the table.Give the button the caption "Update Table" or something more informative - or select an image to display on the button. Set the Action When Clicked to be a call to your procedure. (You can delete everything else from that window; there should be no need for DocumentTools here.) A slight variation on this is to put all of the code for the procedure directly in the Action When Clicked area for the button. Then you will need the DocumentTools skeleton that is provided. I prefer to use the proc because it gives me an easier way to manage the code. (You can hide the proc in a Code Edit Region (under the Insert menu) or as Startup Code (click the icon to the left of the smallest magnifying glass).

I hope this is helpful.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}