|
See the Dentist appointment procedure for an example of Saving configure information in TPS files or changing the Data stored in the ini file so the templates load them on procedure initialization.
You can dynamically change the start time, end time, duration, colors used, etc for most of the templates, and use your own procedures to configure them instead of the runtime controls.
Colors and fonts for the Dentist Appointment Listboxes are stored in the ini file. (Fairly Static Data)
Start Time, End Time, and duration are stored in the Dentist tps file. (Dynamic changes) It also stores which day of the weeks he works, AM or PM, and enables, disables the listboxes when appropriate.
The ini file Stores the information based on the procedure name, and the template instance involved.
The ConfigureColours Procedure sets the colors for the listboxes.
Example snippet to store settings when OK button is pressed.
! AM PUTINI('DentistAppointments5','TIMECOLOR5',BST:TimeColorAM,'.\BST.INI') PUTINI('DentistAppointments5','TIMETEXT5',BST:TimeTextColorAM,'.\BST.INI') PUTINI('DentistAppointments5','APPTBACK5',BST:ApptBackColorAM,'.\BST.INI') PUTINI('DentistAppointments5','APTTEXT5',BST:ApptTextColorAM,'.\BST.INI') PUTINI('DentistAppointments5','DURCOLOR5',BST:AptDurColorAM,'.\BST.INI') PUTINI('DentistAppointments5','DURTEXT5',BST:AptDurTextColorAM,'.\BST.INI') PUTINI('DentistAppointments5','LINEHGHT5',BST:LineHeight,'.\BST.INI')
! PM PUTINI('DentistAppointments8','TIMECOLOR8',BST:TimeColorPM,'.\BST.INI') PUTINI('DentistAppointments8','TIMETEXT8',BST:TimeTextColorPM,'.\BST.INI') PUTINI('DentistAppointments8','APPTBACK8',BST:ApptBackColorPM,'.\BST.INI') PUTINI('DentistAppointments8','APTTEXT8',BST:ApptTextColorPM,'.\BST.INI') PUTINI('DentistAppointments8','DURCOLOR8',BST:AptDurColorPM,'.\BST.INI') PUTINI('DentistAppointments8','DURTEXT8',BST:AptDurTextColorPM,'.\BST.INI') PUTINI('DentistAppointments8','LINEHGHT8',BST:LineHeight,'.\BST.INI')
! Fonts for both listboxes (AM & PM) PUTINI('DentistAppointments5','BsFont',BsFont,'.\BST.INI') PUTINI('DentistAppointments5','BsFsize',BsFsize,'.\BST.INI') PUTINI('DentistAppointments5','BsFcolor',BsFcolor,'.\BST.INI') PUTINI('DentistAppointments5','BsFstyle',BsFstyle,'.\BST.INI') PUTINI('DentistAppointments5','BsFcharset',BsFcharset,'.\BST.INI') PUTINI('DentistAppointments5','FONTORIG',1,'.\BST.INI') PUTINI('DentistAppointments5','BsFontO',BsFont,'.\BST.INI') PUTINI('DentistAppointments5','BsFsizeO',BsFsize,'.\BST.INI') PUTINI('DentistAppointments5','BsFcolorO',BsFcolor,'.\BST.INI') PUTINI('DentistAppointments5','BsFstyleO',BsFstyle,'.\BST.INI') PUTINI('DentistAppointments5','BsFcharsetO',BsFcharset,'.\BST.INI')
PUTINI('DentistAppointments8','BsFont',BsFont,'.\BST.INI') PUTINI('DentistAppointments8','BsFsize',BsFsize,'.\BST.INI') PUTINI('DentistAppointments8','BsFcolor',BsFcolor,'.\BST.INI') PUTINI('DentistAppointments8','BsFstyle',BsFstyle,'.\BST.INI') PUTINI('DentistAppointments8','BsFcharset',BsFcharset,'.\BST.INI') PUTINI('DentistAppointments8','FONTORIG',1,'.\BST.INI') PUTINI('DentistAppointments8','BsFontO',BsFont,'.\BST.INI') PUTINI('DentistAppointments8','BsFsizeO',BsFsize,'.\BST.INI') PUTINI('DentistAppointments8','BsFcolorO',BsFcolor,'.\BST.INI') PUTINI('DentistAppointments8','BsFstyleO',BsFstyle,'.\BST.INI') PUTINI('DentistAppointments8','BsFcharsetO',BsFcharset,'.\BST.INI')
The following code snippet is from a routine that dynamically changes the settings on the listboxes when a new dentist or date is selected in the Dentist appointment procedure.
LoadDentistVariables ROUTINE
FREE(BSHQ5) ! free the queues for the list boxes to ensure that when resource is FREE(BSHQ8) ! changed by user, the list boxes are cleared of previous dentist's appointments
CASE Bs:UseDate % 7 ! work out what day of the week is being displayed OF 0 ! Sunday BST:StartTime5 = DEN:SunMorningStart ! set morning start BST:EndTime5 = DEN:SunMorningFinish ! set morning finish BST:Interval5 = DEN:DefaultApptLength ! set appt length BsSchedID5 = DEN:Dentist ! set resource BST:StartTime8 = DEN:SunAfternoonStart BST:EndTime8 = DEN:SunAfternoonFinish BST:Interval8 = DEN:DefaultApptLength BsSchedID8 = DEN:Dentist OF 1 BST:StartTime5 = DEN:MonMorningStart BST:EndTime5 = DEN:MonMorningFinish BST:Interval5 = DEN:DefaultApptLength BsSchedID5 = DEN:Dentist BST:StartTime8 = DEN:MonAfternoonStart BST:EndTime8 = DEN:MonAfternoonFinish BST:Interval8 = DEN:DefaultApptLength BsSchedID8 = DEN:Dentist OF 2 BST:StartTime5 = DEN:TueMorningStart BST:EndTime5 = DEN:TueMorningFinish BST:Interval5 = DEN:DefaultApptLength BsSchedID5 = DEN:Dentist BST:StartTime8 = DEN:TueAfternoonStart BST:EndTime8 = DEN:TueAfternoonFinish BST:Interval8 = DEN:DefaultApptLength BsSchedID8 = DEN:Dentist OF 3 BST:StartTime5 = DEN:WedMorningStart BST:EndTime5 = DEN:WedMorningFinish BST:Interval5 = DEN:DefaultApptLength BsSchedID5 = DEN:Dentist BST:StartTime8 = DEN:WedAfternoonStart BST:EndTime8 = DEN:WedAfternoonFinish BST:Interval8 = DEN:DefaultApptLength BsSchedID8 = DEN:Dentist OF 4 BST:StartTime5 = DEN:ThuMorningStart BST:EndTime5 = DEN:ThuMorningFinish BST:Interval5 = DEN:DefaultApptLength BsSchedID5 = DEN:Dentist BST:StartTime8 = DEN:ThuAfternoonStart BST:EndTime8 = DEN:ThuAfternoonFinish BST:Interval8 = DEN:DefaultApptLength BsSchedID8 = DEN:Dentist OF 5 BST:StartTime5 = DEN:FriMorningStart BST:EndTime5 = DEN:FriMorningFinish BST:Interval5 = DEN:DefaultApptLength BsSchedID5 = DEN:Dentist BST:StartTime8 = DEN:FriAfternoonStart BST:EndTime8 = DEN:FriAfternoonFinish BST:Interval8 = DEN:DefaultApptLength BsSchedID8 = DEN:Dentist OF 6 BST:StartTime5 = DEN:SatMorningStart BST:EndTime5 = DEN:SatMorningFinish BST:Interval5 = DEN:DefaultApptLength BsSchedID5 = DEN:Dentist BST:StartTime8 = DEN:SatAfternoonStart BST:EndTime8 = DEN:SatAfternoonFinish BST:Interval8 = DEN:DefaultApptLength BsSchedID8 = DEN:Dentist END
DO ClearLocalVariables ! Clear the conflict Handling Variables !-----------------------------------------------------------------------------------
|