screen.c

来自「PocketCMD是与pocketconsole配合实用的命令行解释器(Shel」· C语言 代码 · 共 107 行

C
107
字号
/* * SCREEN.C - screen internal command. * * clone from 4nt msgbox command * * 30 Aug 1999 *     started - Paolo Pantaleo <paolopan@freemail.it> * * */#include "config.h"#ifdef INCLUDE_CMD_SCREEN#include "cmd.h"INT CommandScreen (LPTSTR cmd, LPTSTR param){	SHORT x,y;	BOOL bSkipText = FALSE;	if (_tcsncmp (param, _T("/?"), 2) == 0)	{		ConOutPuts(		              _T("move cursor and optionally print text\n")		              _T("\n")		              _T("SCREEN row col [text]\n")		              _T("\n")		              _T("  row         row to wich move the cursor\n")		              _T("  col         column to wich move the cursor"));		return 0;	}	//get row	while(_istspace(*param))		param++;	if(!(*param))	{		error_req_param_missing ();		return 1;	}	y = (SHORT)_ttoi(param);	if (y<0 || y>(maxy-1))	{		ConOutPrintf(_T("invalid value for	row"));		return 1;	}	//get col	if(!(param = _tcschr(param,_T(' '))))	{		error_req_param_missing ();		return 1;	}	while(_istspace(*param))		param++;	if(!(*param))	{		error_req_param_missing ();		return 1;	}	x = (SHORT)_ttoi(param);	if (x<0 || x>(maxx-1))	{		ConErrPuts(_T("invalid value for col"));		return 1;	}	//get text	if(!(param = _tcschr(param,_T(' '))))	{		bSkipText = TRUE;	}	else	{		while(_istspace(*param))			param++;		if(!(*param))		{			bSkipText = TRUE;		}	}	bIgnoreEcho = TRUE;	if(bSkipText)		x=0;	SetCursorXY(x,y);	if(!(bSkipText))		ConOutPuts(param);	return 0;}#endif /* INCLUDE_CMD_SCREEN */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?