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

📄 vbs87.htm

📁 VBScript 是一种脚本语言
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML>
<HEAD><TITLE>CStr 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="CStr function,String function,text converting,numbers converting,strings converting,text,numbers,strings"><META NAME="Description" CONTENT="CStr 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>CStr 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;1</A>&nbsp;<P></FONT>
</TD></TR>
</TABLE> <P>
<FONT SIZE=2>
<A HREF="vbs88.htm">See Also</A></FONT>
<HR NOSHADE SIZE=1>

<H5>Description</H5>
<BLOCKQUOTE>Returns an expression that has been converted to a <b>Variant</b> of subtype <b>String</b>.</BLOCKQUOTE>

<H5>Syntax</H5>
<BLOCKQUOTE><b>CStr(</b><i>expression</i><b>)</b><P>
The <i>expression</i> argument is any valid expression.</BLOCKQUOTE>

<H5>Remarks</H5>
<BLOCKQUOTE>In general, you can document your code using the data type conversion functions to show that the result of some operation should be expressed as a particular data type rather than the default data type. For example, use <b>CStr</b> to force the result to be expressed as a <b>String</b>.<p>
You should use the <b>CStr</b> function instead of <b>Str</b> to provide internationally aware conversions from any other data type to a <b>String</b> subtype. For example, different decimal separators are properly recognized depending on the 
<A HREF="vbs0.htm#defLocale">locale</A> setting of your system.<P>

The data in <i>expression</i> determines what is returned according to the following table:<P>

<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
<TD><FONT SIZE=2><b>If <I>expression</I> is</b></FONT></TD>
<TD><FONT SIZE=2><b>CStr returns</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Boolean</b></FONT></TD>
<TD><FONT SIZE=2>A <B>String</B> containing <B>True</B> or <B>False</B>. </FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Date</b></FONT></TD>
<TD><FONT SIZE=2>A <B>String</B> containing a date in the short-date format of your system.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Null</b></FONT></TD>
<TD><FONT SIZE=2>A run-time error.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Empty</b></FONT></TD>
<TD><FONT SIZE=2>A zero-length <B>String</B> (&quot;&quot;).</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><b>Error</b></FONT></TD>
<TD><FONT SIZE=2>A <B>String</B> containing the word Error followed by the error number.</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2>Other numeric</FONT></TD>
<TD><FONT SIZE=2>A <B>String</B> containing the number.</FONT></TD></TR></TABLE>
</BLOCKQUOTE><p>

<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 + -