Maplets[Tools] - Maple Programming Help

Home : Support : Online Help : Programming : Maplets : Tools : Maplets/Tools/Get

Maplets[Tools]

 Get
 retrieve an element option value from a running Maplet application

 Calling Sequence Get(objs, opts) Get(handle, objs, opts)

Parameters

 objs - object(s) being retrieved opts - equation(s) of the form option=value where option is one of corrections or update; specify options for retrieving an element option value from a Maplet application handle - identifier for the Maplet application

Description

 • The Get(obj, opts) and Get(handle, obj, opts) calling sequences retrieve the value of a specified element option from a running Maplet application. Refer to individual Element help pages or see Maplets/ElementOptions to determine the element options with which Get can be used.
 • The use of Get is limited to within procedures, including library procedures. Get cannot be used in a Maplet application definition.
 • If handle is not provided, Get must be used within a procedure called by the execution of an Evaluate command element. The variable thismaplet can be used to specify the calling Maplet application.
 • Each object in objs must be in one of the following forms where ref is a reference to an element in the Maplet application, opt is a symbol indicating an option for the referenced element, typ is the required type of the specified value, and reference specifies that the value being retrieved is a reference to another element in the Maplet application.

 ref ref(opt) ref::typ ref(opt)::typ ref(opt)::reference

 If no option opt is specified, the value option is retrieved.
 If a type typ is specified, the object is parsed. That is, the double quotations are removed from the string. For example, the parsed value of $"1"$ is $1$. If the object does not parse, an error is raised. If the object parses, but is not of type typ, an error is raised.  Otherwise, the parsed value of the option opt is returned.
 • The opts argument can contain one or more of the following equations that define Get options.
 corrections = true or false
 If this option is set to true and any item that is associated with a type fails to parse or fails to be of the appropriate type, an input dialog is displayed that prompts the user to correct it. By default, the value is false.
 update = true or false
 If this option is set to true, any changes to the option value in the procedure are copied to the element option in the Maplet application. By default, the value is false.

Examples

Try this example by using the following as entries in the input field: 'x', '[x]', and 'x y'. With the last two inputs, the Maplet application returns errors.

 > MyProc := proc()    local integrand;    int(Maplets:-Tools:-Get('TF1'::algebraic, corrections), x); end proc:
 > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$
 > $\mathrm{maplet1}≔\mathrm{Maplet}\left(\left[\mathrm{TextField}\left['\mathrm{TF1}'\right]\left(\right),\left[\mathrm{Button}\left("Integrate w.r.t. x",\mathrm{Evaluate}\left('\mathrm{TF1}'="MyProc"\right)\right),\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{TF1}'\right]\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet1}\right)$

Compare the error messages displayed by the following Maplet application by using '[x]' and 'x y'.

 > $\mathrm{maplet2}≔\mathrm{Maplet}\left(\left[\mathrm{TextField}\left['\mathrm{TF1}'\right]\left(\right),\left[\mathrm{Button}\left("Integrate w.r.t. x",\mathrm{Evaluate}\left('\mathrm{TF1}'='\mathrm{int}\left(\mathrm{TF1},x\right)'\right)\right),\mathrm{Button}\left("OK",\mathrm{Shutdown}\left(\left['\mathrm{TF1}'\right]\right)\right)\right]\right]\right):$
 > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet2}\right)$

Note that the error messages are similar to:

 > $\mathrm{int}\left(\left[x\right],x\right)$
 > int(x y, x);