Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ComboBox With Zero-based Array
Message
 
À
09/07/2000 15:35:05
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00390001
Message ID:
00390017
Vues:
10
>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform