MapleKernelOptions
set or query kernel variables and options in external code
Calling Sequence
Parameters
Description
Examples
MapleKernelOptions(kv, option, val)
kv
-
kernel handle returned by StartMaple
option
character string
val
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