ParamArray ArgList()中可变数量的参数 [英] Variable number of arguments in ParamArray ArgList()

查看:63
本文介绍了ParamArray ArgList()中可变数量的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想通过数组为ParamArray arglist传递多个值,该怎么办?到目前为止,从VBA上看,似乎需要明确列出要传递的值.但是,如果要传递的值的数量可能不同,那么我不知道要传递多少个值该怎么办?有没有办法使用尺寸可变的数组(一维数组)?

If I want to pass a number of values for the ParamArray arglist via an array, how do I do it? From what I've read so far, on VBA, it appears that I need to explicitly list the values that I want to pass. But what if there are potentially different numbers of values to pass, so I do not know in advance how many I'll want to pass to the function? Is there not some way of using an array (a one-dimensional array) with a variable dimension?

推荐答案

如果函数包含参数数组,则可以将可变数量的值传递给函数:

You can pass a variable number of values to a function if the function includes a Param Array:

http://msdn.microsoft.com/en-us/library/538f81ec(v = VS.71).aspx

http://msdn.microsoft.com/en-us/library/aa164809(v = office.10).aspx

这篇关于ParamArray ArgList()中可变数量的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆