数组整数与数组变量

数组整数与数组变量

本文介绍了数组整数与数组变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用数组时,我发现我无法使用具有整数值的变量来维度和数组

但是我可以将其重新定义为

方式。我没有看到任何信息告诉我这是否是一个要求,

虽然看起来是因为如果我尝试的话我会收到错误。


Ex。


昏暗b

b = 10

点亮a(b)''这个错误但是

Dim a()''这个

Redim a(b)''作品

-

Roland Hall

/ *这些信息的分发是希望它有用,但

没有任何保证;甚至没有适销性的暗示保证

或特定用途的适用性。 * /

Technet脚本中心 -

WSH 5.6文档 -

MSDN Library -

解决方案




我几个月前在工作中遇到了完全相同的问题,只是使用了
$最后b $ b redim似乎没问题 - 只是假设是设计好的......


Rob





b = 101

Redim a (b)

response.write ubound(a)


看,妈妈,没有暗淡!


- -

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数)

In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven''t see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.

Ex.

Dim b
b = 10
Dim a(b) '' this errors out but
Dim a() '' this
Redim a(b) '' works
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

解决方案



I had exactly the same problem at work a few months back, just used the
redim in the end and it seemed ok - just assumed it was by design...

Rob




b = 101
Redim a(b)
response.write ubound(a)

Look, mama, no dims!

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于数组整数与数组变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 13:03