MapleToComplexFloat32 - convert a Maple object to a 32-bit complex float pair
MapleToComplexFloat64 - convert a Maple object to a 64-bit complex float pair
MapleToComplexFloatDAG - convert a Maple object to a complex software float pair
MapleToFloat32 - convert a Maple object to a 32-bit float
MapleToFloat64 - convert a Maple object to a 64-bit float
MapleToInteger8 - convert a Maple object to a 8-bit integer
MapleToInteger16 - convert a Maple object to a 16-bit integer
MapleToInteger32 - convert a Maple object to a 32-bit integer
MapleToM_BOOL - convert a Maple object to a hardware boolean
MapleToM_INT - convert a Maple object to a machine word sized integer
MapleToString - convert a Maple object to a character array
|
Calling Sequence
|
|
MapleToComplexFloat32(kv, s)
MapleToComplexFloat64(kv, s)
MapleToComplexFloatDAG(kv, s)
MapleToFloat32(kv, s)
MapleToFloat64(kv, s)
MapleToInteger8(kv, s)
MapleToInteger16(kv, s)
MapleToInteger32(kv, s)
MapleToM_BOOL(kv, s)
MapleToM_INT(kv, s)
MapleToString(kv, s)
|
|
Parameters
|
|
kv
|
-
|
kernel handle returned by StartMaple
|
s
|
-
|
Maple object
|
|
|
|
|
Description
|
|
•
|
These functions are part of the OpenMaple interface to Microsoft Visual Basic.
|
•
|
The MapleTo* functions convert a Maple object to a hardware data structure format. The return values are defined in maple.bas.
|
|
Note: The maple.bas file is in the extern/include directory of your Maple installation.
|
•
|
Floating-point numbers may lose precision during the conversion to hardware size data.
|
•
|
Conversion from a Maple string object to an integer returns the ASCII value of the first character in that string. Conversion from a Maple boolean to an integer returns 1 for true, 0 for false, and -1 for FAIL.
|
•
|
The M_INT and M_BOOL conversions are equivalent to MapleToInteger32. They are provided in the C API for machine word-size conversions. Future versions of VB OpenMaple may allow up to 64-bit conversions using these functions, depending on the underlying hardware.
|
|
|
Examples
|
|
Function MyRand(ByVal kv As Long) As Double
|
Dim r As Long
|
r = EvalMapleStatement(kv,
|
"RandomTools:-Generate([integer(range=-2^31..2^31-1),float]);")
|
If IsMapleList(kv, r) And MapleNumArgs(kv, r) = 2 Then
|
Dim f As Double
|
Dim i As Long
|
i = MapleToInteger32(kv, MapleListSelect(kv, r, 1))
|
f = MapleToFloat64(kv, MapleListSelect(kv, r, 2))
|
MyRand = i * f
|
Else
|
MyRand = 0
|
End If
|
End Function
|
|
|
|
|