Return - Maple Help

Maplets[Elements]

 Return
 encapsulate value(s) to be returned from Maplet application

 Calling Sequence Return(opts, element_content) Return[refID](opts, element_content)

Parameters

 opts - equation(s) of the form reference=value; specify options for the Return element_content - any number of ReturnItem elements refID - name or string; reference to the element

Description

 • The Return element encapsulates ReturnItem elements, which specify the values to return to Maple when the Maplet application closes.
 • To simplify specifying options in the Maplets package, certain options and contents can be set without using an equation. The following table lists elements, symbols, and types (in the left column) and the corresponding option or content (in the right column) to which inputs of this type are, by default, assigned.

 Elements, Symbols, or Types Assumed Option or Content refID reference option

 • A Return element can contain any number of ReturnItem elements.
 • A Return element can be contained in a Maplet element.
 • The following table describes the control and use of the Return element options.
 An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition).
 An x in the R column indicates that the option is required in the calling sequence.
 An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool.
 An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool.

 Option I G S R reference x

 • The opts argument can contain one or more of the following equations that set Maplet application options.
 reference = name or string
 A reference to the Return element.
 If the reference is specified by both an index, for example, Return[refID], and a reference in the calling sequence, the index reference takes precedence.

Examples

 > $\mathrm{with}\left({\mathrm{Maplets}}_{\mathrm{Elements}}\right):$
 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left[\mathrm{BoxCell}\left("Enter some text:"\right)\right],\left[{\mathrm{TextField}}_{'\mathrm{TF1}'}\left(\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\mathrm{return}='\mathrm{R1}'\right)\right)\right]\right],{\mathrm{Return}}_{'\mathrm{R1}'}\left(\mathrm{ReturnItem}\left('\mathrm{item}'='\mathrm{TF1}'\right)\right)\right):$
 > ${\mathrm{Maplets}}_{\mathrm{Display}}\left(\mathrm{maplet}\right)$

This Maplet application can be rewritten by using the following shortcut.

 > $\mathrm{maplet}≔\mathrm{Maplet}\left(\left[\left[\mathrm{BoxCell}\left("Enter some text:"\right)\right],\left[{\mathrm{TextField}}_{'\mathrm{TF1}'}\left(\right)\right],\left[\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{TF1}'\right]\right)\right)\right]\right]\right):$
 > ${\mathrm{Maplets}}_{\mathrm{Display}}\left(\mathrm{maplet}\right)$