/*Copyright (C) 1992, 1995 by Thomas Glen Smith. All Rights Reserved.*/
/* funcgoto APL2 V1.0.0 ************************************************
* Called by funcsusq when a branch is to be made. *
***********************************************************************/
#define INCLUDES APLCB+APLFUNCI+APLTOKEN+STDIO
#include "includes.h"
int funcgoto(fp,rite,stmtno)
struct aplfunc *fp; /* function definition structure */
Aplcb rite; /* APL variable indicating branch location */
int stmtno; /* current statement number */
{
Ivalue;
extern int aplerr;
int ret,term;
ret = term = fp->funcstmt; /* last statement */
if (rite != NULL) {
if (rite->aplcount == 0) {
ret = stmtno + 1; /* vacuous */
endoper(rite);
}
else {
ret = ivalue(rite);
if (ret < 1) ret = term; /* terminate function */
}
}
return(ret-1); /* funcexec will bump to correct statement */
}