当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Column 属性

ASP
ASP 介绍
ASP Install
ASP 语法
ASP 变量
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error
ASP FileSystem
ASP TextStream

ASP Column 属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 337 ::
收藏到网摘: n/a

The Column property returns the column number of the current character position in an input stream.
ASP Column属性返回的是当前的字符处于整条文本中的第几个,即:返回当前字符所处的列数。

Note: This property is 1 after a new line character is written (even before any other character is written).
注意:这个属性只是针对同一行文本而言的,如果新的一行文本开始,那么它将又从数字1开始重新计数,而不是接续前面的文本计数。

Syntax
语法

TextStreamObject.Column

Example
举例

<%
dim fs,f,t,x,y
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:test.txt")
f.write("Hello World!")
f.close
set t=fs.OpenTextFile("c:test.txt",1,false)
do while t.AtEndOfStream<>true x=t.Read(1) y=t.Column-1
loop
t.close
Response.Write("The last character in the text file is: " & x)
Response.Write("<br /> at character position: " & y)
%>

Output:

The last character in the text file is: !
at character position: 12


评论 (0) All

登陆 | 还没注册?