This project has moved. For the latest updates, please go here.

First problem with matrix dim declaration

Apr 24, 2009 at 1:12 PM
Found in doc (vb declaration): Public Sub New ( rows As Integer,  columns As Integer )

I need a "long" not "integer" matric dimensions! is it possible?

Apr 24, 2009 at 4:41 PM
The maximum size of an integer is a bit over 2 billion. A 2 billion X 2 billion matrix has 4 X 10<sup>18</sup> entries and would require about ten billion gigabytes of memory just to store. So I take it you don't actually need a matrix with dimensions that can only fit in a long. :-)

As long as the value of your long is not that big, you can cast it to an integer, either via CType(longVariable,Integer) or Convert.ToInt32(longVariable).
Apr 25, 2009 at 7:48 PM

You right - my mistake - first thought about short integer, second about db's probles. In vb and c# int has 2,147,483,647.


but don't understand what did you mean in case of CType?

Apr 25, 2009 at 10:21 PM
CType is the VB casting operator. You can read the documentation here.