将数组清零 [英] Zero out Array

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

问题描述

有没有快速的方法用零填充数组或使所有元素

为空/什么?

Is there a quick way to fill an array with zeros or make all elements
empty/nothing?

推荐答案

这取决于。


指定昏暗中的数组尺寸应根据您的

要求填写它。


dim intArray(5)as integer''elements s / b 0

dim objArray(5)as string''elements s / b nothing


但是再说一次,我假设你还没有充实你的问题

完全。


你可以擦除数组,将变量设置为新数组,初始化数组,

等......这实际上取决于你想要完成的是什么。


DazedAndConfused < AC ******** @ yahoo.com>在消息中写道

新闻:iO ******************** @ comcast.com ...

|有没有快速的方法用零填充数组或使所有元素

|空/无?
it depends.

specifying the array dimensions in the dim should fill it based on your
requirements.

dim intArray(5) as integer '' elements s/b 0
dim objArray(5) as string '' elements s/b nothing

but then again, i assume you just haven''t fleshed out your question
completely.

you can erase arrays, set variables to new arrays, initialize arrays,
etc....it really depends on what it is you''re trying to accomplish.

"DazedAndConfused" <Ac********@yahoo.com> wrote in message
news:iO********************@comcast.com...
| Is there a quick way to fill an array with zeros or make all elements
| empty/nothing?


你的权利我没有准确描述我在做什么。


数组尺寸为共享朋友。

元素填充数据并进行处理。

数组需要在重新加载新数据之前清空,而不需要

redimensioning。


我知道我可以使用for循环来重置数组,但是我想看看是否有更好的方法来获得
。我将看看擦除阵列提供的内容。让我

知道是否有更好的方法。


谢谢。

"?" < a@b.com>在留言新闻中写道:j4 ****************** @ fe07.lga ...
Your right I didn''t give an accurate description of what I am doing.

The array is dimensioned as Shared Friend.
The elements are populated with data and processed.
The array needs to be emptied out before reloading with new data without
redimensioning.

I know I can use for loops to reset the array, but I was looking to see if
there is a better way. I will look to see what erase array offers. Let me
know if there is a better way.

Thank You.
"" <a@b.com> wrote in message news:j4******************@fe07.lga...
取决于它。

指定dim中的数组尺寸应根据您的要求填充它。

dim intArray(5)as integer''elements s / b 0
dim objArray(5)作为字符串''元素s / b没什么

但是再说一遍,我认为你还没有完全充实你的问题。

你可以擦除数组,将变量设置为新数组,初始化数组等等......这实际上取决于你想要完成的是什么。

DazedAndConfused < AC ******** @ yahoo.com>在消息中写道
新闻:iO ******************** @ comcast.com ......
|有没有快速的方法用零填充数组或制作所有元素
|空/没什么?
it depends.

specifying the array dimensions in the dim should fill it based on your
requirements.

dim intArray(5) as integer '' elements s/b 0
dim objArray(5) as string '' elements s/b nothing

but then again, i assume you just haven''t fleshed out your question
completely.

you can erase arrays, set variables to new arrays, initialize arrays,
etc....it really depends on what it is you''re trying to accomplish.

"DazedAndConfused" <Ac********@yahoo.com> wrote in message
news:iO********************@comcast.com...
| Is there a quick way to fill an array with zeros or make all elements
| empty/nothing?



ReDim似乎给了我想要的结果,但我不确定这是否是

是正确的方法,因为我并没有真正改变尺寸大小。我应该在我ReDim之前擦除阵列吗?

" DazedAndConfused" < AC ******** @ yahoo.com>在消息中写道

新闻:E4 ******************** @ comcast.com ...
ReDim appears to be giving me the result I wanted, but I am unsure if this
is the proper way because I am not really changing dimension sizes. Should I
also be erasing the array before I ReDim?
"DazedAndConfused" <Ac********@yahoo.com> wrote in message
news:E4********************@comcast.com...
你的对,我没有给出我正在做的事情的准确描述。

数组的大小为共享朋友。
元素填充数据并进行处理。
数组需要在重新加载新数据之前清空,而不需要重新定位。

我知道我可以使用for循环来重置数组,但我当时想看看是否有
是一种更好的方式。我将看看擦除阵列提供的内容。让我知道是否有更好的方法。

谢谢。
"?" < a@b.com>在留言新闻中写道:j4 ****************** @ fe07.lga ...
Your right I didn''t give an accurate description of what I am doing.

The array is dimensioned as Shared Friend.
The elements are populated with data and processed.
The array needs to be emptied out before reloading with new data without
redimensioning.

I know I can use for loops to reset the array, but I was looking to see if
there is a better way. I will look to see what erase array offers. Let me
know if there is a better way.

Thank You.
"" <a@b.com> wrote in message news:j4******************@fe07.lga...
取决于它。

指定dim中的数组尺寸应根据您的要求填充它。

dim intArray(5)as integer''elements s / b 0
dim objArray(5)作为字符串''元素s / b没什么

但是再说一遍,我认为你还没有完全充实你的问题。

你可以擦除数组,将变量设置为新数组,初始化数组等等......这实际上取决于你想要完成的是什么。

DazedAndConfused < AC ******** @ yahoo.com>在消息中写道
新闻:iO ******************** @ comcast.com ......
|有没有快速的方法用零填充数组或制作所有元素
|空/无?
it depends.

specifying the array dimensions in the dim should fill it based on your
requirements.

dim intArray(5) as integer '' elements s/b 0
dim objArray(5) as string '' elements s/b nothing

but then again, i assume you just haven''t fleshed out your question
completely.

you can erase arrays, set variables to new arrays, initialize arrays,
etc....it really depends on what it is you''re trying to accomplish.

"DazedAndConfused" <Ac********@yahoo.com> wrote in message
news:iO********************@comcast.com...
| Is there a quick way to fill an array with zeros or make all elements
| empty/nothing?




这篇关于将数组清零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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