günther
24th July 2009, 14:36
Hi,
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:
declaration:
#include <bic_process>
extern domain tcdate date.f, date.t
field.date.f:
before.zoom:
zoom.to.calendar(date.f)
field.date.t:
before.zoom:
zoom.to.calendar(date.t)
functions:
function zoom.to.calendar(ref domain tcdate date)
{
long child
| Start the calandar with a given date
child = activate("ottstpcalendar", str$(date))
| wait until the calendar is done
wait(child, WTHANG)
| get the return value
date = g.value
| stop the standard program from zooming (it will hang!)
attr.zoomcode = 0
attr.zoomsession$ = ""
}
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:
declaration:
#include <bic_process>
extern domain tcdate date.f, date.t
field.date.f:
before.zoom:
zoom.to.calendar(date.f)
field.date.t:
before.zoom:
zoom.to.calendar(date.t)
functions:
function zoom.to.calendar(ref domain tcdate date)
{
long child
| Start the calandar with a given date
child = activate("ottstpcalendar", str$(date))
| wait until the calendar is done
wait(child, WTHANG)
| get the return value
date = g.value
| stop the standard program from zooming (it will hang!)
attr.zoomcode = 0
attr.zoomsession$ = ""
}