Guest_imported
New member
- Jan 1, 1970
- 0
I'm coding an application to study some mathematical
functions.
It needs that a tridimesional matrix is initialized according to user's indications, CHANGING THE INITIAL AND FINAL RANGE OF THE FIRST INDEX.
IE
If user writes 2 values, initial and final, that are stored in variables START and END in my wishes code should be:
dim matrice (start to end , 500 to 1000, 1 to 100)
for x=start to end
for y= 500 to 100
for z= 1 to 100
.....
alfa (x,y,z)=something.....
next
next
next
But VB6 gives error message at dim matrice (start to end....
sayng that a constant is needed for initialization.
It works if code is
dim matrice (4000 to 5000, ....
but gives arror indicating variables.
I tried to give as initial index the difference between End and Start
delta=end-start
dim matrice (delta, 500 to 100, 1 to 100)
for x=start to end
and this is fine, but then the error comes when it goes to
create the alfa(x,y,z), sayng that index is not right: in my wishes the first index should be 4000, while VB6 expects 1.
I tried also a dynamic matrix but it gives same error.
Any help to override this problem would be greatly
appreciated.
Gipodiablo
functions.
It needs that a tridimesional matrix is initialized according to user's indications, CHANGING THE INITIAL AND FINAL RANGE OF THE FIRST INDEX.
IE
If user writes 2 values, initial and final, that are stored in variables START and END in my wishes code should be:
dim matrice (start to end , 500 to 1000, 1 to 100)
for x=start to end
for y= 500 to 100
for z= 1 to 100
.....
alfa (x,y,z)=something.....
next
next
next
But VB6 gives error message at dim matrice (start to end....
sayng that a constant is needed for initialization.
It works if code is
dim matrice (4000 to 5000, ....
but gives arror indicating variables.
I tried to give as initial index the difference between End and Start
delta=end-start
dim matrice (delta, 500 to 100, 1 to 100)
for x=start to end
and this is fine, but then the error comes when it goes to
create the alfa(x,y,z), sayng that index is not right: in my wishes the first index should be 4000, while VB6 expects 1.
I tried also a dynamic matrix but it gives same error.
Any help to override this problem would be greatly
appreciated.
Gipodiablo