Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I do this in fewer steps?
Message
From
11/08/2000 13:57:53
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00404043
Message ID:
00404057
Views:
14
Make that COUNT, not SUM.

>You can shorten the source code, although the same amount of processing would take place. For example
SUM FOR code = 15 to ii
>PUBLIC ARRAY asite(ii, 2)
>etc.
As an alternative, consider doing away with arrays altogether and write a method using AddItem to populate the combo box at run time. Put the code in the REFRESH method of the combo box, or make it an external method and call it from REFRESH.
>
>
>>I repeat these six lines of code 30+ times in my Form Init. Can I shorten it instead of repeating it 30 times with the only difference being a different SCAN FOR = code and a different array name in each of the 30+ sets of code?
>>
>>I did it this way so I could add to my lookup table without modifying the PUBLIC ARRAY size every time I did an add to my lookup table. My lookup table contains comboxbox items to populate most comboboxes on my forms.
>>
>>ii = 0
>>SELECT lookup
>>SCAN FOR code = 15
>>ii = ii + 1
>>ENDSCAN
>>PUBLIC ARRAY asite(ii,2)
>>
>>Then, I wouldn't have to count the items in the lookup table to know the array size. I would think there is a better way than this way. How about it? Help please. Thanks.
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Reply
Map
View

Click here to load this message in the networking platform