1 /*****************************************************************************
2 
3 	ExeGtr()
4 
5 	This function executes a greater-than-sign (>) command.
6 	>	End iteration
7 
8 *****************************************************************************/
9 
10 #include "zport.h"		/* define portability identifiers */
11 #include "tecoc.h"		/* define general identifiers */
12 #include "defext.h"		/* define external global variables */
13 #include "deferr.h"		/* define identifiers for error messages */
14 
ExeGtr()15 DEFAULT ExeGtr()				/* execute a > command */
16 {
17 	DBGFEN(1,"ExeGtr",NULL);
18 
19 	if (LStTop == LStBot) {			/* if not in loop */
20 		ErrMsg(ERR_BNI);		/* BNI = > not in iteration */
21 		DBGFEX(1,DbgFNm,"FAILURE");
22 		return FAILURE;
23 	}
24 
25 	if (LStack[LStTop].LIndex != INFINITE) {/* if not infinite loop */
26 		--LStack[LStTop].LIndex;	/* decrement loop counter */
27 	}
28 	if ((LStack[LStTop].LIndex == INFINITE) ||	/* if infinite loop */
29 	    (LStack[LStTop].LIndex > 0)) {	/* or more iterations to do */
30 		CBfPtr = LStack[LStTop].LAddr;	/* jump to front of loop */
31 	} else {
32 		--LStTop;			/* leave the loop */
33 	}
34 	CmdMod = '\0';				/* clear modifiers flags */
35 	EStTop = EStBot;			/* clear expression stack */
36 
37 	DBGFEX(1,DbgFNm,"SUCCESS");
38 
39 	return SUCCESS;
40 }
41