Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
MapleAssign - assign a value to a Maple variable in external code
MapleAssignIndexed - assign to an indexable object element in external code
Calling Sequence
MapleAssign(kv, lhs, rhs)
MapleAssignIndexed(kv, lhs, n, ind, rhs)
Parameters
kv
-
kernel handle returned by StartMaple
lhs
assignable Maple object
rhs
Maple object
n
length of ind
ind
index array
Description
These functions are part of the OpenMaple interface to Microsoft Visual Basic.
The MapleAssign function attempts to assign lhs := rhs.
The MapleAssignIndexed function attempts to assign lhs[ind] := rhs. The index, ind is an array of 32-bit integers. To reference lhs[1,2], set ind[0] = 1, and ind[1] = 2.
Examples
Sub TestMapleAssign(ByVal kv As Long)
Dim a, b, r, val As Long
Dim index(1) As Long
' assign to Maple variables a and b
a = ToMapleName(kv, "a", True)
MapleAssign kv, a, ToMapleFloat(kv, 3.14)
b = ToMapleName(kv, "b", True)
MapleAssign kv, b, ToMapleFloat(kv, 2.71)
' compute a*b
val = EvalMapleStatement(kv, "a*b;")
'save the result in a table called my_results
r = ToMapleName(kv, "my_results", True)
index(0) = 1
index(1) = 1
MapleAssignIndexed kv, r, 2, index(0), val
MapleALGEB_Printf1 kv, "%a", val
MapleALGEB_Printf1 kv, "%a", MapleSelectIndexed(kv, r, 2, index(0))
EvalMapleStatement kv, "eval(my_results);"
End Sub
See Also
OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples
Download Help Document