Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox With Zero-based Array
Message
 
To
09/07/2000 15:35:05
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00390001
Message ID:
00390017
Views:
11
>>I have a combo box to choose values ranging from 0 to whatever.
>>
>>Before I write code to always add one to the table value, and then subtract one when writing to the table, anybody got any better ideas?


Ahh, the reverse of those pesky VB problems! (In recent versions of VB (starting with 5.0 or maybe even 6) you can start an array at any element, so it's easier to overcome).

Here's one suggestion -- if the read/write code is tight enough (i.e. all in one method) you might consider defined constants.

#DEFINE d_0 1
#DEFINE d_1 2...

I use the d_ prefix because AFAIK, you cannot, in foxpro, define one number as another outright.

Here's another suggestion -- write a method to more easily wrap the code you are dealing with -- so you could call THIS.WriteElement(1) and the WriteElement method would do the subtracting for ya.
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Reply
Map
View

Click here to load this message in the networking platform