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

	ExeCtQ()

	This function executes a control-Q command.

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

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

extern	DEFAULT	GetNmA();	/* get numeric argument */
extern	DEFAULT	PushEx();	/* push expression onto expression stack */
extern	LONG	Ln2Chr();	/* convert line offset to character offset */

EXTERN	BYTE	CmdMod;		/* command modifiers flags for @, :, etc. */
EXTERN	WORD	EStBot;		/* expression stack bottom */
EXTERN	WORD	EStTop;		/* expression stack top */
EXTERN	LONG	NArgmt;		/* numeric argument */


DEFAULT ExeCtQ()		/* execute a ^Q (control-Q) command */
{
#if DEBUGGING
DbgInd+=2;if(DbgLvl>=1){DbgMsg();DbgDBf("ExeCtQ: called.\015\012");DbgROf();}
#endif

	if (EStTop == EStBot)			/* if no numeric argument */
		{
		CmdMod = '\0';			/* clear modifiers flags */
#if DEBUGGING
if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeCtQ: returning PushEx(0).\015\012");DbgROf();}DbgInd-=2;
#endif
		return(PushEx(0L, OPERAND));
		}

	if (GetNmA() == FAILURE)		/* get numeric argument */
#if DEBUGGING
{if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeCtQ: returning FAILURE.\015\012");DbgROf();}DbgInd-=2;
#endif
		return(FAILURE);
#if DEBUGGING
}
#endif

	CmdMod = '\0';				/* clear modifiers flags */
#if DEBUGGING
if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeCtQ: returning PushEx().\015\012");DbgROf();}DbgInd-=2;
#endif
	return(PushEx(Ln2Chr(NArgmt), OPERAND));
}
