ASP Column 属性

定义和用法

Column 属性返回输入流中当前字符位置的列号。

注释:此属性在新行字符 (new line character ) 被写入之后为 1 (在其他字符被写入前)。

语法:

  1. TextStreamObject.AtEndOfStream

实例

  1. <%
  2. dim fs,f,t,x,y
  3. set fs=Server.CreateObject("Scripting.FileSystemObject")
  4. set f=fs.CreateTextFile("c:\test.txt")
  5. f.write("Hello World!")
  6. f.close
  7.  
  8. set t=fs.OpenTextFile("c:\test.txt",1,false)
  9. do while t.AtEndOfStream<>true
  10. x=t.Read(1)
  11. y=t.Column-1
  12. loop
  13. t.close
  14. Response.Write("The last character in the text file is: " & x)
  15. Response.Write("<br /> at character position: " & y)
  16. %>

输出:

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