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
Parameters
Description
Examples
MapleListAlloc(kv, n)
MapleListAssign(kv, list, i, val)
MapleListSelect(kv, list, i)
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
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.
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