ÆÄÀÏ Æ÷ÀÎÅÍ°¡ TextStream ÆÄÀÏÀÇ ³¡¿¡ ¿Ô´Â°¡¸¦ ºÎ¿ï°ªÀ¸·Î ¹ÝȯÇÑ´Ù.
objectName.AtEndOfStream
object´Â Ç×»ó TextStream °³Ã¼ÀÇ À̸§ÀÌ´Ù.
false | ÆÄÀÏ Æ÷ÀÎÅÍ°¡ TextStream ÆÄÀÏÀÇ ³¡¿¡ ¿ÀÁö ¾Ê¾Ò´Ù. |
true | ÆÄÀÏ Æ÷ÀÎÅÍ°¡ TextStream ÆÄÀÏÀÇ ³¡¿¡ ¿Ô´Ù. |
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
AtEndOfStream ¼Ó¼ºÀº ¿·ÁÀÖ´Â TextStream ÆÄÀÏ¿¡¸¸ Àû¿ëµÈ´Ù.
±×·¸Áö ¾ÊÀ¸¸é ¿À·ù°¡ ¹ß»ýÇÑ´Ù.
<SCRIPT language=JScript> function AtEndOfStreamTest(filePath){ var fso,fileObj,ForReading,str=''; ForReading=1; ForWriting=2; fso=new ActiveXObject('Scripting.FileSystemObject'); fileObj=fso.OpenTextFile(filePath,ForWriting,true); fileObj.WriteLine('ù° ÁÙ ¹®Àå '); fileObj.WriteLine('µÑ° ÁÙ ¹®Àå '); fileObj.WriteLine('¼¼Â° ÁÙ ¹®Àå '); fileObj.WriteLine('³×° ÁÙ ¹®Àå '); fileObj.Close(); fileObj=fso.OpenTextFile(filePath,ForReading,false); line=1; str+='line#'+line+') '; while (!fileObj.AtEndOfStream){ if (fileObj.AtEndOfLine){ str+='<BR>'; line++; str+='line#'+line+') '; } str+=fileObj.Read(1); } fileObj.Close(); return(str); } </SCRIPT> <DIV id=showjs class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showjs.innerHTML=AtEndOfStreamTest('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=property>AtEndOfStream</SPAN> ¿¹Á¦</DIV>
<SCRIPT language=VBScript> Function AtEndOfStreamTestvb(filePath) Dim fso,fileObj,str,line Const ForReading=1,ForWriting=2 Set fso=CreateObject("Scripting.FileSystemObject") Set fileObj=fso.OpenTextFile(filePath,ForWriting,true) fileObj.WriteLine "ù° ÁÙ ¹®Àå " fileObj.WriteLine "µÑ° ÁÙ ¹®Àå " fileObj.WriteLine "¼¼Â° ÁÙ ¹®Àå " fileObj.WriteLine "³×° ÁÙ ¹®Àå " fileObj.Close Set fileObj=fso.OpenTextFile(filePath,ForReading,False) line=0 Do While fileObj.AtEndOfStream <> true If (fileObj.AtEndOfLine) Then str=str&"<BR>" line=line+1 str=str&"line#"&line&") " End If str=str&fileObj.Read(1) Loop fileObj.Close AtEndOfStreamTestvb=str End Function </SCRIPT> <DIV id=showvb class=show alt="°á°ú">°á°ú Ç¥½Ãâ</DIV> <DIV class=show onClick="showvb.innerHTML=AtEndOfStreamTestvb('C:\\JsTest\\expSample.txt')"> <SPAN class=ie>VBScript</SPAN> <SPAN class=property>AtEndOfStream</SPAN> ¿¹Á¦</DIV>