set or query kernel variables and options in external code - Maple Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Programming : OpenMaple : VB Application Programming Interface : System and Maple Properties : OpenMaple/VB/MapleKernelOptions

MapleKernelOptions - set or query kernel variables and options in external code

Calling Sequence

MapleKernelOptions(kv, option, val)




kernel handle returned by StartMaple



character string



Maple object



This function is part of the OpenMaple interface to Microsoft Visual Basic.


The MapleKernelOptions function sets and queries variables that affect Maple computations. For a list of option names and descriptions, see ?kernelopts.


To query a value without setting it, pass val = 0. The previous assigned value is returned.


Function MyDelay(ByVal kv As Long, n As Long) As Double

    Dim i As Long

    Dim start_time, fin_time As Double

    ' turn assertions on (for fun)

    MapleKernelOptions kv, "assertlevel", ToMapleInteger(kv, 2)

    'run a delay loop

    start_time = MapleToFloat64(kv, MapleKernelOptions(kv, "cputime", 0))

    For i = 1 To n

        ' do nothing

        MapleAssign kv, ToMapleName(kv, "c", True), ToMapleInteger(kv, i)

        EvalMapleStatement kv, "c*c:"

    Next i

    fin_time = MapleToFloat64(kv, MapleKernelOptions(kv, "cputime", 0))

    ' elapsed time

    MyDelay = fin_time - start_time

End Function

MyDelay kv, 100

See Also

kernelopts, 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