Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
DocumentTools[Do] - User-friendly access to embedded components
Calling Sequence
Do(expr)
Do(var=expr)
Do(target=expr, refreshopt)
Parameters
expr
-
algebraic ; expression to evaluate using component values
var
name ; variable in which to store the retrieved value
target
name ; target component to store results
refreshopt
expression of the form refresh = value, where value is true or false; specifies whether or not to immediately update the document
Description
The Do command evaluates its argument using values retrieved from specified embedded components.
Optionally, the result can be stored into an embedded component
A naming convention is used to access component values.The expression %name refers to the component named name
By default, the attribute that will be queried or set is value, except for MathExpressionComponent for which the attribute that will be queried or set is expression. Alternate attributes can be specified using %name(attr)
After retrieving an attribute of a component, the result will be parsed and must be a valid Maple expression. To avoid parsing, refer to the component using %%name. Note that parsing of the value attribute of a MathExpressionComponent will result in an error (the expression attribute should be used instead).
After parsing, a type-check can be automatically applied by specifying the type using %name::type or %name(attr)::type. An error will be generated if the expression is not of the given type.
The result of querying component attributes can optionally be stored in a variable or in another component.
To store the value in a variable, use Do(myvar= ... %ComponentName ...).
To store the value in another component, use Do(%Comp1 = ... %Comp2 ...).
Note: Some embedded components, like Label, do not have a value attribute. To retrieve or set attributes on such components, an explicit attribute needs to be specified, e.g. %MyLabel(caption).
By default, when this command is invoked from inside the code which is executed as the action of another embedded component, the document is not updated until that code terminates. The option refresh = true (or just refresh) can be used to force the document to update during the call to Do.
Examples
Insert a Math Expression component and two Text Area components from the Components palette. Change the name of each component to expression, from, and to respectively by editing the Name field in the component properties. To display the component properties, right-click (Control-click for Macintosh) the component and select Component from the context menu. Save the changes and then enter an expression into the Math Expression component and integers into the two Text Area components accordingly.
Insert three Math Expression components called ResultField, InputField1, and InputField2. Enter expressions into the InputFields.
Insert two Math Expression components, and enter an integer into the first, called PrecisionField, and an expression which evaluates to a floating point value in the second, called Input.
Insert a Button component called MyButton, and two Text Area components, called TF and MF. Enter numbers into both of the Text Area components.
Insert two Plot components called Plot1 and Plot2.
This example shows a math container being updated at two second intervals, using the refresh option.
See Also
DocumentTools, MathExpressionComponent, TextAreaComponent
Download Help Document