ARGTYPE

Purpose:

Returns the data type of the input argument.

Syntax:

ARGTYPE(arg)

arg

-

Any value.

Returns:

An integer representing the data type. The following return values are possible:

-11:

Unspecified

1:

Integer

2:

Real

3:

Complex

4:

String

5:

Series

6:

Window

10:

Function

104:

Pointer

105:

Object Handle

120:

Window Reference

Example:

a = 10;

b = 12.5i;

c = "text";

 

argtype(a)

returns 1.

 

argtype(a*1.1)

returns 2.

 

argtype(b)

returns 3.

 

argtype(c)

returns 4.

 

argtype({1, 2})

returns 5.

 

argtype(W1)

returns 6.

Example:

W1: 1..100;h=text(30.0, 30.0, "Test text")

 

argtype(h)

returns 105.

Example:

myfun(x)
{
    local type;
 
    type = argtype(x);
 
    if (type != 5 || type != 6)
    {
        error("myfun - series required");
    }
    else
    {
        return(integ(x * x));
    }
}

Remarks:

ARGTYPE is useful in checking for the proper type of arguments in SPL functions. See the include file SERIES.H for helpful macros that use ARGTYPE.

See Also:

VALUETYPE