assign to the attribute RTableSettings field in external code - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Programming : OpenMaple : VB Application Programming Interface : RTable Manipulation : OpenMaple/VB/RTableSetAttribute

RTableSetAttribute - assign to the attribute RTableSettings field in external code

RTableAppendAttribute - append to the attribute RTableSettings field in external code

RTableSetIndFn - assign to the index_functions RTableSettings field in external code

RTableAppendIndFn - append to the index_functions RTableSettings field in external code

RTableSetType - assign to the data_type and maple_type RTableSettings field in external code

Calling Sequence

RTableSetAttribute(kv, rts, name)

RTableAppendAttribute(kv, rts, name)

RTableSetIndFn(kv, rts, indfn)

RTableAppendIndFn(kv, rts, indfn)

RTableSetType(kv, rts, id, name)




kernel handle returned by StartMaple



RTableSettings structure



name of an attribute or type



Maple indexing function object



data_type identifier



These functions are part of the OpenMaple interface to Microsoft Visual Basic.


These functions update an RTableSettings structure. They are provided for convenience. The RTableSettings structure can be modified directly. Some extra argument checking is done.


RTableSetAttribute(kv,rts,name) is equivalent to

rts.attributes = (kv,1)

MapleExpseqAssign kv,1,(kv,name,TRUE)


Attributes can be retrieved using the attributes command in Maple.


RTableAppendAttribute(kv,rts,name) is equivalent to the following.

dim attrib, i, n as long

n = MapleNumArgs(kv,rts.attributes)

attrib = NewMapleExpressionSequence(kv,n+1)

For i=1 to n

    MapleExpseqAssign kv, attrib, i, MapleExpseqSelect(kv,attrib,i)

Next i

MapleExpseqAssign kv, attrib, i, MapleToName(kv,name,True)

rts.attributes = attrib


RTableSetIndFn and RTableAppendIndFn are the same as RTableSetAttribute and RTableAppendAttribute except they modify rts.index_functions instead of rts.attributes to set the indexing function property.


RTableSetType sets the data_type and maple_type fields of the RTableSettings structure.  This command is equivalent to the following code.

rts.data_type = id

If id = RTABLE_DAG then

    rts.maple_type = ToMapleName(kv,name,True)



Public Sub TestSetAttribute(ByVal kv As Long)

    Dim rt As Long

    Dim rts As RTableSettings

    ' input (rtable and rows to swap)

    rt = EvalMapleStatement(kv, "rtable(1..6,1..6,(i,j)->i);")

    ' set new properties

    RTableGetSettings kv, rts, rt

    RTableSetIndFn kv, rts, RTABLE_INDEX_SYMMETRIC

    rts.p1 = 2  'band parameters

    rts.p2 = 2

    RTableAppendIndFn kv, rts, RTABLE_INDEX_BAND

    RTableSetType kv, rts, RTABLE_DAG, "integer"

    RTableSetAttribute kv, rts, "red"

    RTableAppendAttribute kv, rts, "square"

    ' make a copy with the new properties

    rt = RTableCopy(kv, rts, rt)

    MapleALGEB_Printf1 kv, "new rtable = %a", rt

End Sub

See Also

OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples, rtable, trademarks

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