create a list in external code - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Programming : OpenMaple : VB Application Programming Interface : List and Table Manipulation : OpenMaple/VB/MapleListAlloc

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)




kernel handle returned by StartMaple



number of elements in the list



Maple list object



index of entry in a list



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

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam