<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; Вызов в VBScript функции из массива]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8393&amp;type=atom" />
	<updated>2013-06-14T21:53:09Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8393</id>
		<entry>
			<title type="html"><![CDATA[Re: Вызов в VBScript функции из массива]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=72971#p72971" />
			<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-06-14T21:53:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=72971#p72971</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Вызов в VBScript функции из массива]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=72970#p72970" />
			<content type="html"><![CDATA[<p>Еще такой вопрос по массивам:</p><div class="codebox"><pre><code>
Option Explicit

dim matrix
dim a, b

&#039; Двухмерный массив
matrix = Array(Array(2,4,5), Array(8,5,99,6))

&#039; верхняя граница
a = UBound(matrix)

&#039; вернет  - выход за пределы, почему?
b = UBound(matrix,2)

&#039; работает
MsgBox matrix(0)(1)
&#039; вернет 1 !!! почему?
MsgBox a
</code></pre></div><p>Почему функция UBound неверно определяет границу массива для первого измерения и не хочет определять для второго? Или я просто что то не так делаю?</p>]]></content>
			<author>
				<name><![CDATA[fomenos]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28568</uri>
			</author>
			<updated>2013-06-14T21:21:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=72970#p72970</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Вызов в VBScript функции из массива]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=72969#p72969" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Set new_arr(0) = GetRef(&quot;new_fun&quot;)
MsgBox new_arr(0)(4, 10)
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2013-06-14T20:54:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=72969#p72969</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Вызов в VBScript функции из массива]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=72968#p72968" />
			<content type="html"><![CDATA[<p>Есть такой простой пример:</p><div class="codebox"><pre><code>
dim new_arr(4), i, s

function new_fun(x,y)
    new_fun=x+y
end function

new_arr(0) = 0
new_arr(1) = &quot;строка&quot;
new_arr(2) = new_fun(x,y)
new_arr(3) = 100
new_arr(4) = #10/05/2000#

for each i in new_arr
    s = s &amp; i &amp; vbCrLf  
next

MsgBox s
</code></pre></div><p>Можно ли и как вызвать функцию new_fun из массива new_arr. В JScript это просто:</p><div class="codebox"><pre><code>
var arr = new Array(2);

fun_new = function(x,y){return x+y};

arr[0]=fun_new;
arr[1]=100;
arr[2]=20;

//Вызываем функцию
WScript.Echo (arr[0](4,10));
</code></pre></div><p>А как это в VBscript сделать?</p>]]></content>
			<author>
				<name><![CDATA[fomenos]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28568</uri>
			</author>
			<updated>2013-06-14T20:32:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=72968#p72968</id>
		</entry>
</feed>
