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

📄 vbs105.htm

📁 VBScript 是一种脚本语言
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>Filter Function</TITLE> 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="PRODUCT" CONTENT="Visual Basic Scripting Edition">
<META NAME="TECHNOLOGY" CONTENT="SCRIPTING">
<META NAME="CATEGORY" CONTENT="Language Reference">

<META NAME="Keywords" CONTENT=""><META NAME="Description" CONTENT="Filter Function"></HEAD>

<BODY BGCOLOR=FFFFFF LINK=#0033CC>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR VALIGN=TOP><TD WIDTH=360>
<FONT SIZE=1 COLOR=#660033>Microsoft&#174; Visual Basic&#174; Scripting Edition</FONT><BR>
<FONT SIZE=5 COLOR=#660033><B>Filter Function</B></FONT>

</TD>
<TD ALIGN=RIGHT>
<FONT SIZE=2>&nbsp;<A HREF="vbstoc.htm">Language&nbsp;Reference</A>&nbsp;<BR>
<A HREF="vbs16.htm">Version&nbsp;2</A>&nbsp;<P></FONT>
</TD></TR>
</TABLE> 
<FONT SIZE=2><P>
<A HREF="vbs106.htm">See Also</A></FONT>
<HR noshade SIZE=1>

<H5>Description</H5>
<BLOCKQUOTE>
	Returns a zero-based array containing subset of a string array based on a specified filter criteria.
</BLOCKQUOTE>

<H5>Syntax</H5>
<BLOCKQUOTE>
	<b>Filter(</b><i>InputStrings</i><b>,</b> <i>Value</i>[<b>,</b> <i>Include</i>[<b>,</b> <i>Compare</i>]]<b>)</b><P>
The <b>Filter</b> function syntax has these parts:<P>

<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
	<TD><FONT SIZE=2><b>Part</b></FONT></TD>
		<TD><FONT SIZE=2><b>Description</b></FONT></TD></TR>
<TR VALIGN=TOP>
	<TD><FONT SIZE=2><i>InputStrings</i></FONT></TD>
		<TD><FONT SIZE=2>Required. One-dimensional array of strings to be searched.</FONT></TD></TR>
<TR VALIGN=TOP>
	<TD><FONT SIZE=2><i>Value</i></FONT></TD>
		<TD><FONT SIZE=2>Required. String to search for.</FONT></TD></TR>
<TR VALIGN=TOP>
	<TD><FONT SIZE=2><i>Include</i></FONT></TD>
		<TD><FONT SIZE=2>Optional. Boolean value indicating whether to return substrings that include or exclude <i>Value</i>. If <i>Include</i> is <b>True</b>, <b>Filter</b> returns the subset of the array that contains <i>Value</i> as a substring. If <i>Include </i>is <b>False</b>, <b>Filter</b> returns the subset of the array that does not contain <i>Value</i> as a substring.</FONT></TD></TR>
<TR VALIGN=TOP>
	<TD><FONT SIZE=2><i>Compare</i></FONT></TD>
		<TD><FONT SIZE=2>Optional. Numeric value indicating the kind of string comparison to use. See Settings section for values.</FONT></TD></TR>
</TABLE>
</BLOCKQUOTE><P>

<H5>Settings</H5>
<BLOCKQUOTE>
The <i>Compare</i> argument can have the following values:<p>
<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
	<TD WIDTH=15%><FONT SIZE=2><b>Constant</b></FONT></TD>
		<TD WIDTH=10%><FONT SIZE=2><b>Value</b></FONT></TD>
			<TD WIDTH="*"><FONT SIZE=2><b>Description</b></FONT></TD></TR>
<TR VALIGN=TOP>
	<TD WIDTH=15%><FONT SIZE=2><B>vbBinaryCompare</B></FONT></TD>
		<TD ALIGN=CENTER WIDTH=10%><FONT SIZE=2>0</FONT></TD>
			<TD WIDTH= "*"><FONT SIZE=2>Perform a binary comparison.</FONT></TD></TR>

<TR VALIGN=TOP>
	<TD WIDTH=15%><FONT SIZE=2><B>vbTextCompare</B></FONT></TD>
		<TD ALIGN=CENTER WIDTH=10%><FONT SIZE=2>1</FONT></TD>
			<TD WIDTH="*"><FONT SIZE=2>Perform a textual comparison.</FONT></TD></TR>

</TABLE>
</BLOCKQUOTE><P>

<H5>Remarks</H5>
<BLOCKQUOTE>
If no matches of <i>Value</i> are found within <i>InputStrings</i>, <b>Filter</b> returns an empty array. An error occurs if <i>InputStrings</i> is <B>Null</B> or is not a one-dimensional array.<p>
The array returned by the <b>Filter</b> function contains only enough elements to contain the number of matched items.

</BLOCKQUOTE>

<hr noshade size=1>
<p align=center><em><a href="../../common/colegal.htm">&copy; 1997 by Microsoft Corporation. All rights reserved.</a></em></p> 

</FONT></BODY></HTML>



















































































⌨️ 快捷键说明

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