YABD
YABD

Reputation: 5

I can't understand what means this line of code

I am reading an old code written with vb and I can not understand what means this line of code

CType(Cache("tabl"), Array)(CInt(Cache("lg")), 0) = myValue

Any help please?

Upvotes: 0

Views: 88

Answers (2)

tezzo
tezzo

Reputation: 11105

It is setting a multidimensional array, using values obtained from Cache object.

A more readable code could be something like this:

Dim yourArray as Array = CType(Cache("tabl"), Array)
Dim intPosition as Integer = CInt(Cache("lg"))

yourArray(intPosition, 0) = myValue

Upvotes: 2

Sathish
Sathish

Reputation: 4487

CType(Cache("tabl"), Array) --> Convert to Array

(CInt(Cache("lg")), 0) --> Position (So tab1 is two dimenstional Array)

myValue Assign the value is that position

Like

array1(0,0)=10

Upvotes: 3

Related Questions