Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding the next available time slot
Message
 
 
To
01/11/2002 19:06:37
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00718072
Message ID:
00718176
Views:
17
Hi Henry,

I would do this a little bit differently. I will allow user to selects doctor and date and use GetDateSlots method below to get all available slots. The result will be displayed in the grid so user can pick desired slot.
PROCEDURE GetDateSlots  
* Retrieves available lots for specified day and doctor.
LPARAMETERS tdAppDate, tnDocNumber 

* Select existing apointments for the doctor 
SELECT app_date, app_time, blocked, lcl_number ;
	FROM appointments ;
	WHERE app_date = tdAppDate AND lcl_number = tnDocNumber  ;
	INTO CURSOR appointmentlist NOFILTER 

* Get the list of 
SELECT tdAppDate AS app_date, app_time, Appointime, slot_refer ;
	FROM timeslots;
	WHERE timeslots.app_time NOT IN ( ;
			SELECT app_time FROM appointmentlist) ;
	INTO CURSOR AvailableTimeSlotsForThisDoctor NOFILTER;
ENDPROC
You can also add 'Next Day' button so user would have easier vay to move to the next day.

>Hi all:
>
>I am working on a form which is expected to do the following:
>
>1. Select a name from the combobox (this works)
>2. User clicks the "Find Slot" commandbutton which has the following code:
>
< snip >
>
>This is where i am not achieving the desired outcome. What I want happenning each time the user clicks "Find Next Slot" that all available timeslots are reflected in the two text boxes on the form, one show the date that is being processed and the other the timeslot. Clicking on the "Select this" command button sets mSeletThisSlot = .t. at which time the Do While loop should exit.
>
>
>Where am I going wrong? Thank you for your advise.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform