<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7197</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7197&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBS: AtEndOfStream не дает дописывать. Как быть?».]]></description>
		<lastBuildDate>Fri, 11 May 2012 21:09:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60226#p60226</link>
			<description><![CDATA[<p>И специалиста — тоже <img src="//forum.script-coding.com/img/smilies/wink.png" width="15" height="15" />.</p><p><a href="http://msdn.microsoft.com/en-us/library/zw39ybk8(v=vs.85).aspx">With Statement (VBScript)</a>.</p><p>Причём кому-то он так сильно не нравился, что в PoSH его убрали: <a href="http://technet.microsoft.com/en-us/library/ee177030.aspx">Converting VBScript&#039;s With Statement</a>, что довольно-таки странно.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Fri, 11 May 2012 21:09:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60226#p60226</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60201#p60201</link>
			<description><![CDATA[<p>С точки зрения неспециалиста — отличная конструкция <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Позволяет «не таскать по скрипту экземпляр объекта» <br />.Close пишется потому как действие сие применяется к объекту указанному в аргументе With</p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Fri, 11 May 2012 15:29:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60201#p60201</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60190#p60190</link>
			<description><![CDATA[<p>Извините за назойливость, но что это за конструкция With ......End With? В поиске не могу найти описания, если есть дайте ссылку. И почему пишется&nbsp; &quot;.Close&quot;, а не например &quot;File.Close&quot;?</p>]]></description>
			<author><![CDATA[null@example.com (griha09)]]></author>
			<pubDate>Fri, 11 May 2012 13:48:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60190#p60190</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60159#p60159</link>
			<description><![CDATA[<p><strong>griha09</strong>, общий принцип примерно таков:<br /></p><div class="codebox"><pre><code>&#039; IOMode Enum
Const ForReading   = 1
Const ForWriting   = 2
Const ForAppending = 8

Dim objFSO
Dim objFile

Dim boolFound
…


Set objFSO = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)

For Each objFile In objFSO.GetFolder(strSource).Files
    With objFSO.OpenTextFile(objFile, ForReading)
        boolFound = False
        
        Do Until .AtEndOfStream
            strLine = .ReadLine()
            
            If InStr(1, strLine, word) &lt;&gt; 0 Then
                boolFound = True
                
                Exit Do
            End If
        Loop
        
        .Close
    End With
    
    If boolFound Then
        With objFSO.OpenTextFile(objFile, ForAppending)
            .WriteLine(&quot;&lt;!--OK--&gt;&quot;)
            .Close
        End With
    End If
Next</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Fri, 11 May 2012 08:10:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60159#p60159</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60150#p60150</link>
			<description><![CDATA[<p>закрыл вот так(по другому вроде никак) </p><div class="codebox"><pre><code>If InStr(1, sw, word) &lt;&gt; 0 Then
file1.close
Set file1 = objFSO.OpenTextFile(objFile, 8, False)
file1.WriteLine(&quot;&lt;!--OK--&gt;&quot;)</code></pre></div><p>все равно ругается &quot;Недопустимый режим файла &quot;</p>]]></description>
			<author><![CDATA[null@example.com (griha09)]]></author>
			<pubDate>Fri, 11 May 2012 03:47:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60150#p60150</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60135#p60135</link>
			<description><![CDATA[<p>Закройте текстовый файл перед повторным открытием для дополнения.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Thu, 10 May 2012 19:58:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60135#p60135</guid>
		</item>
		<item>
			<title><![CDATA[VBS: AtEndOfStream не дает дописывать. Как быть?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=60134#p60134</link>
			<description><![CDATA[<p>Что хочу сделать, пробегаюсь по файлам если есть искомая строка добавляю пометку, но AtEndOfStream не дает дописывать. Как быть?</p><div class="codebox"><pre><code>Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set file2 = objFSO.OpenTextFile(file, 2, True) 

For Each objFile In objFSO.GetFolder(strSource).Files        
Set file1 = objFSO.OpenTextFile(objFile, 1, False)

While Not file1.AtEndOfStream
sw = file1.ReadLine()

If InStr(1, sw, word) &lt;&gt; 0 Then
Set file1 = objFSO.OpenTextFile(objFile, 8, False)
file1.WriteLine(&quot;&lt;!--OK--&gt;&quot;)
End If
  
Wend

file1.close
Next</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (griha09)]]></author>
			<pubDate>Thu, 10 May 2012 19:45:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=60134#p60134</guid>
		</item>
	</channel>
</rss>
