/*Copyright (C) 1992, 1994 by Thomas Glen Smith. All Rights Reserved.*/
/* ivalue APL2 V1.0.0 **************************************************
* Called by assign, depthsub, funcgoto, indexgen, matchsub, partitn. *
* Returns the integer value of the first or only element pointed to by *
* the APLCB passed as argument. *
***********************************************************************/
#define INCLUDES APLCB
#include "includes.h"
int ivalue(rite)
Aplcb rite;
{
Endoper; Errinit; Integer;
extern int aplerr;
int ret;
if (errinit())
return(0);
if (!(rite->aplflags & APLINT)) {
rite=integer(rite);
if (aplerr)
return(0);
}
if (!rite->aplcount) {
aplerr=22; /* empty input */
ret=0;
}
else
ret=*rite->aplptr.aplint;
endoper(rite);
return(ret);
}