Metropoli BBS
VIEWER: execute.c MODE: TEXT (ASCII)
/* Copyright (C) 1994 by Thomas Glen Smith.  All Rights Reserved. */
/* execute APL2 V1.0.0 *************************************************
* Called by aplload and funcsusq.                                      *
* Implements the APL EXECUTE function. Accepts as argument a character *
* vector or scalar containing the representation of an APL statement.  *
***********************************************************************/
#define INCLUDES APLCB+APLCHDEF+TREE
#include "includes.h"
Aplcb execute(rite)
Aplcb rite;
{
	Errstop; Executf; Quadout;
     extern int aplerr;
	extern Treelist treehdr;
     Aplcb out;

	if (0 == rite->aplcount) return(errstop(0,NULL,rite,NULL));
	if (aplerr) /* out of memory? */
		return(errstop(0,NULL,rite,NULL));
	treehdr->lastfun = treehdr->avloff = 0;
	out = executf(rite);
	if (out != NULL && treehdr->lastfun != LEFT_ARROW)
		out = quadout(out); /* print result */
	return(out);
}
[ RETURN TO DIRECTORY ]