MapleNumArgs - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : OpenMaple : VB Application Programming Interface : Data Queries : OpenMaple/VB/ArgumentChecking

MapleNumArgs

return the number of arguments in an EXPSEQ object

IsMapleAssignedName

test if an object is an assigned name

IsMapleComplexNumeric

test if an object is complex numeric

IsMapleNumeric

test if an object is numeric

IsMapleInteger

test if an object is an integer

IsMapleInteger8

test if an object is an 8-bit integer

IsMapleInteger16

test if an object is a 16-bit integer

IsMapleInteger32

test if an object is a 32-bit integer

IsMapleInteger64

test if an object is a 64-bit integer

IsMapleList

test if an object is a list

IsMapleName

test if an object is a name

IsMapleNULL

test if an object NULL

IsMaplePointer

test if an object is a generated pointer

IsMaplePointerNULL

test if an object is the string "NULL"

IsMapleProcedure

test if an object is a Maple procedure

IsMapleRTable

test if an object is an rtable

IsMapleSet

test if an object is a set

IsMapleStop

test for an "end of session" object

IsMapleString

test if an object is a string

IsMapleTable

test if an object is a table

IsMapleUnassignedName

test if an object is an unassigned name

IsMapleUnnamedZero

test if an object is 0

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

MapleNumArgs(kv, s)

IsMapleAssignedName(kv, s)

IsMapleComplexNumeric(kv, s)

IsMapleNumeric(kv, s)

IsMapleInteger(kv, s)

IsMapleInteger8(kv, s)

IsMapleInteger16(kv, s)

IsMapleInteger32(kv, s)

IsMapleInteger64(kv, s)

IsMapleList(kv, s)

IsMapleName(kv, s)

IsMapleNULL(kv, s)

IsMaplePointer(kv, s)

IsMaplePointerNULL(kv, s)

IsMapleProcedure(kv, s)

IsMapleRTable(kv, s)

IsMapleSet(kv, s)

IsMapleStop(kv, s)

IsMapleString(kv, s)

IsMapleTable(kv, s)

IsMapleUnassignedName(kv, s)

IsMapleUnnamedZero(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 IsMaple* functions test the specified type of the given Maple object. These functions all return TRUE (1) when the Maple dag, s, fits the description given by the function name. If s is not of the correct type, FALSE (0) is returned.

• 

MapleNumArgs returns the length of any Maple object.  It is most useful for computing the number of arguments in an expression sequence object.

• 

Several functions can determine what kind of NULL an object is. These are primarily used by automatic C wrapper generation, but are not commonly seen in custom code.   They have been translated from the C API to VB for the sake of completeness.

  

IsMapleUnnamedZero looks for a Maple zero object, but not a name assigned the value zero.

  

IsMapleNULL tests for the empty expression sequence denoted by NULL in the Maple language.

  

IsPointerNULL tests for the C version of NULL (hardware zero), or the Maple string, "NULL".

• 

IsMapleStop can be used to detect the evaluation of the quit command.

• 

The IsMaple...Numeric routines use the Maple type numeric definition. All other tests use the object type definition as defined by the type command. The only significant exception is IsMapleName, which returns TRUE only for NAME objects, while type(t[1], name) returns true even if it is testing a TABLEREF object.

• 

Integer query routines, with the bit size specified in the name, test to ensure that the given Maple object, s, is a Maple integer and also that it can fit into the specified number of bits if converted to a hardware integer.

Examples

    Function MyEvalf(ByVal kv As Long, expr As String) As Double

    Dim r As Long

    r = EvalMapleStatement(kv, "evalf(" + expr + ");")

    If IsMapleNumeric(kv, r) Then

         MyEvalf = MapleToFloat64(kv, r)

    Else

        MyEvalf = 0

    End If

    End Function

    Dim d As Double

    d = MyEvalf(kv, "int(1/(x^2+1),x=-1..1)")

    Write #1, "Test 43: MyEvalf", d

    d = MyEvalf(kv, "[1,2,3]")

    Write #1, "Test 44: MyEvalf", d

See Also

OpenMaple

OpenMaple/VB/API

 


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