⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 w_center.c

📁 [随书类]Dos6.0源代码
💻 C
字号:
/***************************************************************************/
/*																									*/
/*	W_CENTER.C																					*/
/*                                                                         */
/*		Copyright (c) 1991 - Microsoft Corp.											*/
/*		All rights reserved.																	*/
/*		Microsoft Confidential																*/
/*                                                                         */
/* Function to return the starting column of a string consisting of StrLen */
/* number of characters for the string to be centered on a line of the     */
/* current screen. The function will adjust current width of the screen.   */
/* 																								*/
/* int CenterLength( int iStrLen )														*/
/* 																								*/
/* ARGUMENTS:	int iStrLen -	The lenght of a string to be centered on 		*/
/*										the current display.									*/
/* RETURNS:		int 			-  Starting column to make the string centered	*/
/*																									*/
/* johnhe - 03/15/89																			*/
/***************************************************************************/

#include		<bios_io.h>

int CenterLength(int iStrLen)
{
	extern	unsigned char	ScreenWidth;

	return( ((VideoGetWidth() - iStrLen) / 2) + (iStrLen & 1 ? 1 : 0) );
}

⌨️ 快捷键说明

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