Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to have combobox with hours
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01117548
Message ID:
01117554
Vues:
15
>I am trying to do a combobox that would allow the user to select the time:
>07:00
>07:15
>07:45
>08:00
>08:15
>08:45
>...
>17:45
>18:00
>
>When I am using the builder to add manually, it doesn't allow me to enter all those.
>
>What would be the best (easiest) way to do that ?
>
>Thanks
>Eric

Make it as an array.
*---------------------- Location Section ------------------------
*   Library: 	Aformsaction.vcx
*   Class: 		FrmTQM  
*   Method: 	Set_schedule_times() 
*----------------------- Usage Section --------------------------
*)  Description: 
*)

*   Scope:      Public
*   Parameters: 
*$  Usage:      
*$              
*   Returns:  
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	02/17/2005 - WGB
*		MODIFIED
*----------------------------------------------------------------
LOCAL li as integer, ltStartTime as Datetime, lnStartPoint as Integer

LOCAL ARRAY laSchedTimes[50]
DIMENSION thisform.aTimes[50]
ltStartTime = DATEtime(YEAR(DATE()),MONTH(DATE()),DAY(DATE()),7) && Start from 7 AM
lnStartPoint = LEN(TRANSFORM(DATE())) + 2 

FOR li = 1 TO 50
	IF li = 1
		laSchedTimes[1] = m.ltStartTime
	ELSE li = 1
		laSchedTimes[m.li] = laSchedTimes[m.li - 1] + 900 && fifteen minutes between entries = 900 seconds
	ENDIF li = 1
	THISFORM.aTimes[m.li] = SUBSTR(TRANSFORM(laSchedTimes[m.li]), m.lnStartPoint)
NEXT li

ACOPY(thisform.aTimes,thisform.aCurTimes)
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform