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

	ExeCtV()

	This function executes a control-V command.

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

#include "ZPort.h"		/* define portability identifiers */
#include "DefTeco.h"		/* define general identifiers */
#include "DefError.h"		/* define identifiers for error messages */

extern	VOID	ErrMsg();	/* display an error message */
extern	DEFAULT	GetNmA();	/* get numeric argument */

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


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

	if (EStTop == EStBot)			/* if no numeric argument */
		IniSrM = LOWER;
	else
		{
		if (GetNmA() == FAILURE)	/* get numeric argument */
#if DEBUGGING
{if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeCtV: returning FAILURE.\015\012");DbgROf();}DbgInd-=2;
#endif
			return(FAILURE);
#if DEBUGGING
}
#endif
		if (NArgmt)			/* if it wasn't 0^V */
			{
			ErrMsg(ERR_ARG);	/* improper arguments */
#if DEBUGGING
if(DbgLvl>=1)
{DbgMsg();DbgDBf("ExeCtV: returning FAILURE.\015\012");DbgROf();}DbgInd-=2;
#endif
			return(FAILURE);
			}
		IniSrM = NONE;
		}

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