/*****************************************************************************

	ExeFGt()

	This function executes an F> command.

*****************************************************************************/

#include "ZPort.h"		/* define portability identifiers */
#include "DefTeco.h"		/* define general identifiers */

EXTERN	BYTE	CmdMod;		/* command modifiers flags for @, :, etc. */
EXTERN	char	*CBfPtr;	/* pointer into command string */
EXTERN	WORD	EStBot;		/* expression stack bottom */
EXTERN	WORD	EStTop;		/* expression stack top */
EXTERN	WORD	LStBot;		/* bottom of loop stack */
EXTERN	struct	LStck LStack[];	/* loop stack */
EXTERN	WORD	LStTop;		/* top of loop stack */


DEFAULT ExeFGt()				/* execute an F> command */
{
#if DEBUGGING
DbgInd+=2;if(DbgLvl>=1){DbgMsg();DbgDBf("ExeFGt: called.\015\012");DbgROf();}
#endif

	if (LStTop == LStBot)			/* if not in a loop */
#if DEBUGGING
{if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeFGt: returning FAILURE.\015\012");DbgROf();}DbgInd-=2;
#endif
		return(FAILURE);
#if DEBUGGING
}
#endif
	if (LStack[LStTop].LIndex != INFINITE)
		--LStack[LStTop].LIndex;	/* decrement loop count */
	if ((LStack[LStTop].LIndex == INFINITE) ||
	    (LStack[LStTop].LIndex > 0))
		CBfPtr = LStack[LStTop].LAddr;	/* reset to loop start */
	CmdMod = '\0';				/* clear modifiers flags */
	EStTop = EStBot;			/* clear expression stack */
#if DEBUGGING
if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeFGt: returning SUCCESS.\015\012");DbgROf();}DbgInd-=2;
#endif
	return(SUCCESS);
}
