![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Out of curiosity, besides D3, are there other MV products that allow for the use of "variable", rather than "literal", to dimension an array? E.G., "DIM JC(xxx)", opposed to "DIM JC(50)". |
|
In D3, I was able to follow an executed SELECT statement, in a BASIC program, with something like, "CNTR=SYSTEM(11)", then "DIM JC(CNTR)", thereby allowing me to address the size of the array, based on the current number of items being inserted into the array. I realize a dynamic array could be used, but with very large numbers of items in some instances, the dimensioned array works much faster than a dynamic array. |
#3
| |||
| |||
|
|
Out of curiosity, besides D3, are there other MV products that allow for the use of "variable", rather than "literal", to dimension an array? E.G., "DIM JC(xxx)", opposed to "DIM JC(50)". In D3, I was able to follow an executed SELECT statement, in a BASIC program, with something like, "CNTR=SYSTEM(11)", then "DIM JC(CNTR)", thereby allowing me to address the size of the array, based on the current number of items being inserted into the array. I realize a dynamic array could be used, but with very large numbers of items in some instances, the dimensioned array works much faster than a dynamic array. Jim Cronin Kittery Trading Post |
#4
| |||
| |||
|
|
Some platforms treat DIM, EQUATE, and other statements as compiler directives where substitution is done at compile time rather than runtime. That precludes the ability to change the number of elements at runtime. I don't recall which products use which mechanism. I think some products use Pick Flavor to change this behavior. Uh, and I could be way wrong... ![]() |
#5
| |||
| |||
|
|
Out of curiosity, besides D3, are there other MV products that allow for the use of "variable", rather than "literal", to dimension an array? * E.G., "DIM JC(xxx)", opposed to "DIM JC(50)". |
#6
| |||
| |||
|
|
*In D3, I was able to follow an executed SELECT statement, in a BASIC program, with something like, "CNTR=SYSTEM(11)", then "DIM JC(CNTR)", thereby allowing me to address the size of the array, based on the current number of items being inserted into the array. I realize a dynamic array could be used, but with very large numbers of items in some instances, the dimensioned array works much faster than a dynamic array. Yes, it is very hand for this. -- Kevin Powick |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
please note the use of ELEMENT EQU MATRIX TO ARRAY(10) ;* valid EQU, not usable in DIM EQU ELEMENT TO ARRAY(INDEX) ;* valid EQU, usable, see below .... CRT ELEMENT ;* substituded, at compile time, with ARRAY(INDEX) |
|
MAX=10 ;* DIM ARRAY(MAX) ;* this statement is valid |
#9
| |||
| |||
|
|
Out of curiosity, besides D3, are there other MV products that allow for the use of "variable", rather than "literal", to dimension an array? E.G., "DIM JC(xxx)", opposed to "DIM JC(50)". In D3, I was able to follow an executed SELECT statement, in a BASIC program, with something like, "CNTR=SYSTEM(11)", then "DIM JC(CNTR)", thereby allowing me to address the size of the array, based on the current number of items being inserted into the array. I realize a dynamic array could be used, but with very large numbers of items in some instances, the dimensioned array works much faster than a dynamic array. Dynamc arrays alone would be intolerably slow, but perhaps a mixture would |
#10
| |||
| |||
|
|
please note the use of ELEMENT * *; equates EQU MATRIX TO ARRAY(10) * * ;* valid EQU, not usable in DIM EQU ELEMENT TO ARRAY(INDEX) ;* valid EQU, usable, see below * *; MAX=10 ;* * *; DIM ARRAY(MAX) ;* this statement is valid *; *DIM MATRIX ;* this statement is NOT valid * *; FOR I=1 TO MAX * * ARRAY(I)=I*10 NEXT I * Thanks, but the issue I originally addressed (again, "just out of |
![]() |
| Thread Tools | |
| Display Modes | |
| |