Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to set array dimensions to (x,2)?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00317604
Message ID:
00317606
Views:
15
>I do the following:
>DIMENSION myarray (7,2)
>SELECT lookup
>COPY TO ARRAY myarray FOR code = 4
>
>That works to copy the portion of the table where the code field = 4 to the array, but what if I want to have a DIMENSION that is expandable? As in DIMENSION myarray (x,2), where x can vary in length?
>
>I guess what I am asking is how to set the size of myarray if the size of the lookup table FOR code = 4 can change in length/number of records?
>
>I do it now with a SCAN and counting the number of records for code = 4in the table, but there might be a better way. Huh?
>
>My lookup table has like several lookup tables inside of it and that's why I have a code for each table, i.e. - The first lookup pseudo-table within my all-encompassing lookup table is code 1, the second is code 2, and on... But someone might add records to the code 1 table or the code 2 table and so on... So I need to dimension myarray to the adjusted table within a table length. Hope I didn't confuse anyone.
>
>The structure of my all-encompassing lookup table is as follows:
>Desc Char 40 && For example desc = Blue Eyes
>ID Char 2 && For example ID = BL
>Code Num 2 && For example Code = 1 for Eye Color in Lookup table
>
>Thanks in advance.

Hi Steve,

My gut reaction would be an SQL Select statement into the array rather than COPY TO...I haven't done any testing, but I think it might be faster as well.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform