Array的 [英] Array's

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

问题描述

你好


我之前发过关于数组的消息并获得了Cor的帮助和示例。这是


Dim myArray As New ArrayLis

myArray.Add(" Peugeot"

myArray.Add(" Ferari"

myArray.Add(QUOT;菲亚特"

myArray.Add(QUOT;雷诺"

myArray.RemoveAt(0

myArray.Insert(1," Mercedes"

myArray.Clear(


)我想问一下如何循环播放arraylist所以我可以将这些值转换成另一个控件

我试过这个但它得到了错误


私人CarArray作为新的ArrayLis

私人索引为整数


Button1_Onclick .................................. ...............

CarArray.add(Index,Textbox1.Text

指数=指数+


为什么我不能做这个编码

谢谢你

Hello

I messaged before about arrays and got help and example off Cor. Here it is

Dim myArray As New ArrayLis
myArray.Add("Peugeot"
myArray.Add("Ferari"
myArray.Add("Fiat"
myArray.Add("Renault"
myArray.RemoveAt(0
myArray.Insert(1, "Mercedes"
myArray.Clear(

I want to ask how i can loop through an arraylist so i can get these values into another control
I tried this but it gets error

Private CarArray as new ArrayLis
Private Index as intege

Button1_Onclick................................... ...............
CarArray.add(Index, Textbox1.Text
Index = Index +

why can i not do this coding
thank yo

推荐答案

你想要什么?吗?


ArrayList.Add - 方法只有一个签名,只有一个参数作为obj等等要添加到列表中。
What do you want to do ?

The ArrayList.Add - method has got only one signature which takes only one parameter as being the object to be added to the list.


Hi Varun,


晚餐时间在这里,但是很快。


你最好把它添加到一个列表框中,但是要向你展示将

数组添加到文本框的循环,而我很匆忙


\\\

dim i as integer

for i = 0 to myarray.length - 1

mytextbox.text = mytextbox.text& myarray(i).tostring& vbcrlf

next

///


我希望这会有所帮助,


如果有错误,我的确非常快。


:-))

Cor
Hi Varun,

Diner time here but a quick one.

You better can add it to a listbox, but to show you the loop to add the
array to a textbox, while I am in a hurry

\\\
dim i as integer
for i = 0 to myarray.length - 1
mytextbox.text = mytextbox.text & myarray(i).tostring & vbcrlf
next
///

I hope this helps,

If there is an error, I did it really very quick.

:-))

Cor


你好,


我想要做的是遍历arraylist,这样我就可以将这个数组中包含的所有值都添加到数据表中。


我之前使用一个简单的数组使用以下代码循环遍历我的数组并将值添加到数据表中:


索引= 0 To(索引) - 1)

CarDTRow = ds.Tables(QUOT; CarDT")NEWROW()

CarDTRow(QUOT; CarReg")= txtCarReg.Text
$。 b $ b CarDTRow(CarMake)= CarArray(指数)

ds.Tables(" CarDT")。Rows.Add(CarDTRow)

下一个指数


当数值被添加到数据表时我想清空我的数组但我被告知我无法使用arraylist !!

现在我有使用arraylist,我不再确定如何循环我的数组,就像我使用普通数组(不是arrayList)时那样。你可以帮帮我吗?这可能吗?
Hello,

what i want to do is loop through the arraylist so that i can add all the values contained in this array into a datatable.

I used a simple array before with the following code to loop through my array and add values to a datatable:

For Index = 0 To (Index - 1)
CarDTRow = ds.Tables("CarDT").NewRow()
CarDTRow ("CarReg") = txtCarReg.Text
CarDTRow ("CarMake") = CarArray(Index)
ds.Tables("CarDT").Rows.Add(CarDTRow)
Next Index

I wanted to empty my array when the values were added to the datatable but i was told that i couldnt and that i would need to use a arraylist!!

Now that i have to use the arraylist, i am no longer sure on how to loop through my array the way i did when i use just the normal Array (not arrayList). Can u help me with this? Is this possible?


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

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