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
MapleListAlloc - create a list in external code
MapleListAssign - assign into a list in external code
MapleListSelect - select from a list in external code
Calling Sequence
MapleListAlloc(kv, n)
MapleListAssign(kv, list, i, val)
MapleListSelect(kv, list, i)
Parameters
kv
-
kernel handle returned by StartMaple
n
number of elements in the list
list
Maple list object
i
index of entry in a list
val
value to assign into the list
Description
These functions are part of the OpenMaple interface to Microsoft Visual Basic.
The MapleListAlloc function creates a new list that can contain n elements. The list must be filled completely before passing it back to Maple.
The MapleListAssign function sets the ith element of the given list to the value val. Lists can be modified only if they were created by MapleListAlloc and have never entered Maple (for example, as an argument to a function evaluation or returned value). Lists are static objects; once created, they cannot change. For information on working with a dynamic object, see ?RTableCreate.
The MapleListSelect function retrieves the ith element of the given list. Indexing in a list starts at 1.
The size of a list can be obtained using the MapleNumArgs command.
Examples
Sub LuckyNumbers(ByVal kv As Long)
Dim list, args As Long
list = MapleListAlloc(kv, 6)
MapleListAssign kv, list, 1, ToMapleInteger(kv, 1)
MapleListAssign kv, list, 2, ToMapleInteger(kv, 33)
MapleListAssign kv, list, 3, ToMapleInteger(kv, 42)
MapleListAssign kv, list, 4, ToMapleInteger(kv, 50)
MapleListAssign kv, list, 5, ToMapleInteger(kv, 55)
MapleListAssign kv, list, 6, ToMapleInteger(kv, 67)
MapleALGEB_Printf1 kv, "%a", MapleListSelect(kv, list, 4)
MapleALGEB_Printf1 kv, "%a", list
End Sub
See Also
OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples
Download Help Document