与数组.getValue属性混淆 [英] Confused with arrays .getValue property

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

问题描述

大家好.

我在从vb.net的2d数组中获取值时遇到了这个问题

我有一个称为指针的2d数组,该数组具有许多行并且只有2列(pointer( x,1))

在将一些值分配给指针数组之后(所有非零非负数),我使用以下代码来获取一些结果

Hello everyone.

I have this question on getting the value from a 2d array in vb.net

I have a 2d array called pointer that has numerous rows and only 2 columns (pointer(x,1) )

after some values have been assigned to the pointer array (all nonzero non negative) I use the following code to get some results

 For i = cnt To 0 Step -1
                    j = 0
                    k = pointer.GetValue(i, j)
                    l = pointer.GetValue(i, j + 1)
....
....
....

现在的问题是:变量k和l是否应采用存储在指针数组指定坐标中的值?

有趣的是,即使0不等于,k和l也采用值0出现在指针数组中的任何位置.
btw指针数组被声明为Integer,因此k和l变量也被声明为整数.

关于该变量的任何提示吗?

Now the question is: Shouldnt the variable k and l take the values that were stored in the specified coordinates of the pointer array?

funny thing is that k and l take the value 0 even though 0 does not appear anywhere in the pointer array.
btw pointer arrays is declared as an Integer and so are k and l variables.

any hints on this one?

推荐答案



这篇关于与数组.getValue属性混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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