Latest web development tutorials

ASPの列のプロパティ

テキストストリームオブジェクトリファレンス 完全なテキストストリームオブジェクトリファレンス

Columnプロパティは、現在の入力ストリームの文字位置の列番号を返します。

注:改行文字(改行文字)の後に、このプロパティは、(他の文字で書かれる前に)1として書き込まれます。

文法

TextStreamObject.Column

<%
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)
%>

输出:

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


テキストストリームオブジェクトリファレンス 完全なテキストストリームオブジェクトリファレンス