Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Box with Days of Month
Message
De
25/09/2002 08:33:42
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
25/09/2002 08:27:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00704142
Message ID:
00704157
Vues:
19
>m.CurrentYear = YEAR(DATE())
>m.maxyear = m.currentYear + 9
>
>
>for i = m.currentyear to m.maxyear
>
> thisform.clpcombo1.rowsource = str(m.currentyear)
> m.currentyear = m.currentyear + 1
>endfor
>
>this only yields me the very last year which is 2011.

It is obvious that this should happen, since you overwrite the variable with another value each time.

Don't use the RowSource. Instead, populate the Combo "manually", as follows:
for i = year(date()) to year(date()) + 9
	This.AddItem(trans(i))
next
Suggestion: Use the HTML code < PRE > for VFP code - this will maintain formatting (and, specifically here in the UT, show syntax coloring). Press "reply" to see how I did it.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform