AtEndOfLine

(PWS4 IIS4 IIS5)
AtEndOfLine — TextStream ファイル内でファイル ポインタが行末 (EOL) の直前に置かれている場合に真 (true) を返します。それ以外の場合は、偽 (false) を返します。値の取得のみ可能です。

構文

object.AtEndOfLine

パラメータ

object
TextStream オブジェクトを指定します。

戻り値

ファイルポインタが行末 の直前に置かれている場合に TRUE を、それ以外の場合に FALSE を返します。

説明

AtEndOfLine プロパティを使用できるのは、読み取りを行えるように開いた TextStream ファイルに対してだけです。それ以外の場合は、エラーが発生します。

JScript

1
2
3
4
5
6
7
8
9
10
11
12
13
function GetALine(filespec)
{
   var fso, a, s, ForReading;
   ForReading = 1, s = "";
   fso = new ActiveXObject("Scripting.FileSystemObject");
   a = fso.OpenTextFile(filespec, ForReading, false);
   while (!a.AtEndOfLine)
   {
      s += a.Read(1);
   }
   a.Close( );
   return(s);
}

VBScript

1
2
3
4
5
6
7
8
9
10
11
Function ReadEntireFile(filespec)
   Const ForReading = 1
   Dim fso, theFile, retstring
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set theFile = fso.OpenTextFile(filespec, ForReading, False)
   Do While theFile.AtEndOfLine <> True
      retstring = theFile.Read(1)
   Loop
   theFile.Close
   ReadEntireFile = retstring
End Function