although the basic parts had already been discussed, I mananged to figure out one more tricky thing: How to pass an argument to that session, so that the calendar starts with a given date instead of the current date.
Then I decided to build a complete sample; the script can be used *as is*, you only have to create a session and a form with two date fields (date.f, date.t); these must have a zoom session "osstpcalendar".
Here is the script:
extern domain tcdate date.f, date.t
function zoom.to.calendar(ref domain tcdate date)
| Start the calandar with a given date
child = activate("ottstpcalendar", str$(date))
| wait until the calendar is done
| get the return value
date = g.value
| stop the standard program from zooming (it will hang!)
attr.zoomcode = 0
attr.zoomsession$ = ""