Applies to: a form with many date fields; posted in the softvelocity.public.clarion6 newsgroup, ABC calendar class names in the answer.
Problem
A form has many date fields, and each CalendarButton control template seems to add a lot of overhead. The user asks if one calendar button could update whichever date field is selected, using the field equate number.
Solution
- One poster's idea (stated as a guess he had not tried): place one instance of the CalendarButton control. At every other date field use a normal button with an ellipsis icon and put this in its Accepted event:
Calendar1.SelectOnClose = True
Calendar1.Ask('Select a Date',ldate)
IF Calendar1.Response = RequestCompleted
ldate=Calendar1.SelectedDate
DISPLAY(?ldate)
END
Here ldate is the date field to fill and Calendar1 is the calendar class the one template instance populated.
2. An extension template could write that code for you; make it require one instance of the calendar button control.
3. A hand-coded alternative: in the alert key embed of each date entry call a routine such as CHANGE(?, Calendar(CONTENTS(?))), which reads the current field with CONTENTS and writes it back with CHANGE. It uses the poster's own Calendar function, not the template.
4. A Clarion Magazine article on one "floating" drop-down box shared by about 100 controls was named as adaptable to a floating calendar button.
Caveats
- The original poster wrote that the floating idea "just might work" and did not report a result.
- Option 1 was untested by its author.
- Another poster said he would consider the idea for his own templates.
Today (2026)
The calendar class calls shown are the ABC ones and likely unchanged; not re-tested.
Sources: Bill F. (Nov 2006, the question), Eric C., Steve L., Maarten (Nov 2006), Randy R. (Nov 2006) in softvelocity.public.clarion6.