<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: Доступ к объекту через массив vbscript]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8545&amp;type=atom" />
	<updated>2013-08-07T13:31:24Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8545</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Доступ к объекту через массив vbscript]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74296#p74296" />
			<content type="html"><![CDATA[<p>Спасибо!!! То что надо!!!</p>]]></content>
			<author>
				<name><![CDATA[fomenos]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28568</uri>
			</author>
			<updated>2013-08-07T13:31:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74296#p74296</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Доступ к объекту через массив vbscript]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74295#p74295" />
			<content type="html"><![CDATA[<p>Полный текст:<br /></p><div class="codebox"><pre><code>dim my_class
dim new_arr(3)
 
&#039; Создаем класс new_class
Class new_class
     &#039; глобальная видимость
     dim a, b, c
End Class
 
&#039; создаем ссылку на экземпляр vbs класса new_class
set my_class = new new_class

 
&#039;Заполняем свойства
with my_class
     .a = 200
     .b = 500
     .c = 300
end with

new_arr(0) = 0
new_arr(1) = &quot;строка&quot;
&#039; ошибка!!!
Set new_arr(2) = my_class &#039; &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; 


MsgBox new_arr(2).a</code></pre></div>]]></content>
			<author>
				<name><![CDATA[max7]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=10498</uri>
			</author>
			<updated>2013-08-07T13:31:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74295#p74295</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Доступ к объекту через массив vbscript]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74294#p74294" />
			<content type="html"><![CDATA[<p>Можно конечно сделать так:</p><div class="codebox"><pre><code>
dim my_class
dim new_arr(3)
 
&#039; Создаем класс new_class
Class new_class
     &#039; глобальная видимость
     dim a, b, c
End Class
 


new_arr(0) = 0
new_arr(1) = &quot;строка&quot;
set new_arr(2) = new new_class


MsgBox new_arr(2).a
</code></pre></div><p>Но мне надо сначала заполнить свойства объекта, а уже потом добавить объект в массив</p>]]></content>
			<author>
				<name><![CDATA[fomenos]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28568</uri>
			</author>
			<updated>2013-08-07T13:29:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74294#p74294</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: Доступ к объекту через массив vbscript]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74293#p74293" />
			<content type="html"><![CDATA[<p>Присвоение объектов в VBS должно предварятся ключевым словом SET.<br />Должно быть так:<br /></p><div class="codebox"><pre><code>Set new_arr(2) = my_class</code></pre></div><p>В интернете пишут:<br /></p><div class="quotebox"><blockquote><p>Оператор SET используется в VB*-языках, когда идет присваивание объектов, а не встроенных числовых или строковых типов. Отвечает он действительно за подсчет ссылок, так как любой класс VB является COM-объектом (хотя все это и скрыто). Одна из особенностей VB, которую портировали в VBScript.</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[max7]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=10498</uri>
			</author>
			<updated>2013-08-07T13:27:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74293#p74293</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: Доступ к объекту через массив vbscript]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74292#p74292" />
			<content type="html"><![CDATA[<p>Уважаемые форумчане, нужен совет - как в массив vbscript добавить объект. Вот пример:<br /></p><div class="codebox"><pre><code>
dim my_class
dim new_arr(3)
 
&#039; Создаем класс new_class
Class new_class
     &#039; глобальная видимость
     dim a, b, c
End Class
 
&#039; создаем ссылку на экземпляр vbs класса new_class
set my_class = new new_class

 
&#039;Заполняем свойства
with my_class
     .a = 200
     .b = 500
     .c = 300
end with

new_arr(0) = 0
new_arr(1) = &quot;строка&quot;
&#039; ошибка!!!
new_arr(2) = my_class


MsgBox new_arr(2).a
</code></pre></div><p>Очень нужна помощь.</p>]]></content>
			<author>
				<name><![CDATA[fomenos]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28568</uri>
			</author>
			<updated>2013-08-07T13:22:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74292#p74292</id>
		</entry>
</feed>
