Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I do this in fewer steps?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00404043
Message ID:
00404267
Views:
10
>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

COUNT FOR code = 15 TO ii, maybe; if there's no index in use, it's Rushmore optimizable if there's a tag on code, or

SELECT COUNT(*) AS Count15s FROM lookup INTO ARRAY temp GROUP BY code

temp(1) contains the count, and the record pointer in lookup doesn't move

there's gotta be a million was to do this, all better than SCAN

>PUBLIC ARRAY asite(ii,2)
>
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform