MapleKernelOptions - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


MapleKernelOptions

set or query kernel variables and options in external code

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

MapleKernelOptions(kv, option, val)

Parameters

kv

-

kernel handle returned by StartMaple

option

-

character string

val

-

Maple object

Description

• 

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.

Examples

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