69
How do I encode data as ICalendar format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent,oComponent1,oComponent2

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content()
			oComponent1 := oComponent:Components():Add("VCALENDAR")
				oComponent1:Properties():Add("VERSION","2.1"):Parameters():Add("UNICODE",oICalendar:toICalendar(.T.,2/*exPropertyTypeBoolean*/))
				oComponent1:Properties():Add("TEXT","This is just a bit of text to be encoded.")
				oComponent1:Properties():Add("BINARY",oICalendar:toICalendar("This is just a bit of text to be encoded.",1/*exPropertyTypeBinary*/))
				oComponent2 := oComponent1:Components():Add("VEVENT")
					oComponent2:Properties():Add("DTSTART","01/01/2001")
					oComponent2:Properties():Add("DTEND","01/02/2001 10:00:00")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
68
How do I get the occurrences between giving start/end margins

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( "AsArray: " )
		DevOut( Transform(oICalendar:RecurRange("DTSTART=19970310;FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3","01/01/2001","01/01/2002"),"") )
		DevOut( "AsString: " )
		DevOut( Transform(oICalendar:RecurRangeAsString("DTSTART=19970310;FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3","01/01/2001","01/01/2002"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
67
How do I get the value of specified part in the recurrence expression

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( "FREQ: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",0/*exRecurFREQ*/),"") )
		DevOut( "DTSTART: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",1/*exRecurDTSTART*/),"") )
		DevOut( "UNTIL: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",2/*exRecurUNTIL*/),"") )
		DevOut( "COUNT: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",3/*exRecurCOUNT*/),"") )
		DevOut( "INTERVAL: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",4/*exRecurINTERVAL*/),"") )
		DevOut( "WKST: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",14/*exRecurWKST*/),"") )
		DevOut( "BYDAY: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",8/*exRecurBYDAY*/),"") )
		DevOut( "BYMONTHDAY: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",9/*exRecurBYMONTHDAY*/),"") )
		DevOut( "BYYEARDAY: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",10/*exRecurBYYEARDAY*/),"") )
		DevOut( "BYWEEKNO: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",11/*exRecurBYWEEKNO*/),"") )
		DevOut( "BYMONTH: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",12/*exRecurBYMONTH*/),"") )
		DevOut( "BYSETPOS: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",13/*exRecurBYSETPOS*/),"") )
		DevOut( "BYHOUR: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",7/*exRecurBYHOUR*/),"") )
		DevOut( "BYMINUTE: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",6/*exRecurBYMINUTE*/),"") )
		DevOut( "BYSECOND: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",5/*exRecurBYSECOND*/),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
66
How do I check if the recurrence expression is syntactically correct (method 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( "1.A) SyntaxError: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=20151205;FREQ=DAILY;BYDAY=MO",-1/*exRecurSyntaxError*/),"") )
		DevOut( "1.B) SyntaxErrorInfo: " )
		DevOut( Transform(oICalendar:RecurPartValue("DTSTART=20151205;FREQ=DAILY;BYDAY=MO",-2/*exRecurSyntaxErrorInfo*/),"") )
		DevOut( "2.A) SyntaxError: " )
		DevOut( Transform(oICalendar:RecurPartValue("FREQ=DAILY;BYDAY=MO",-1/*exRecurSyntaxError*/),"") )
		DevOut( "2.B) SyntaxErrorInfo: " )
		DevOut( Transform(oICalendar:RecurPartValue("FREQ=DAILY;BYDAY=MO",-2/*exRecurSyntaxErrorInfo*/),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
65
How do I check if the recurrence expression is syntactically correct (method 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( "1. If negative, the expression is incorrect" )
		DevOut( Transform(oICalendar:RecurCheck("DTSTART=20151205;FREQ=DAILY;BYDAY=MO","12/05/2015"),"") )
		DevOut( "2. If negative, the expression is incorrect" )
		DevOut( Transform(oICalendar:RecurCheck("junk","01/01/2001"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
64
How do I check if a specified date match the giving recurrence

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform("12/05/2015","") )
		DevOut( Transform(oICalendar:RecurCheck("DTSTART=20151205;FREQ=DAILY;BYDAY=MO","12/05/2015"),"") )
		DevOut( Transform("12/07/2015","") )
		DevOut( Transform(oICalendar:RecurCheck("DTSTART=20151205;FREQ=DAILY;BYDAY=MO","12/07/2015"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
63
Recur: The 2nd to last weekday of the month

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970929;FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
62
Recur: The 3rd instance into the month of one of Tuesday, Wednesday or Thursday, for the next 3 months

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970904;FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
61
Recur: The last work day of the month

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970805;FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
60
Recur: An example where the days generated makes a difference because of WKST (Sample 2)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
59
Recur: An example where the days generated makes a difference because of WKST (Sample 1)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
58
Recur: Every 20 minutes from 9:00 AM to 4:40 PM every day

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
57
Recur: Every hour and a half for 4 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=MINUTELY;INTERVAL=90;COUNT=4",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
56
Recur: Every 15 minutes for 6 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=MINUTELY;INTERVAL=15;COUNT=6",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
55
Recur: Every 3 hours from 9:00 AM to 5:00 PM on a specific day

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
54
Recur: Every four years, the first Tuesday after a Monday in November, forever (U.S. Presidential Election day)

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19961105T090000;FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
53
Recur: The first Saturday that follows the first Sunday of the month, forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970913T090000;FREQ=MONTHLY;BYDAY=SA;BYMONTHDAY=7,8,9,10,11,12,13",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
52
Recur: Every Friday the 13th, forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
51
Recur: Every Thursday, but only during June, July, and August, forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970605T090000;FREQ=YEARLY;BYDAY=TH;BYMONTH=6,7,8",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
50
Recur: Every Thursday in March, forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970313T090000;FREQ=YEARLY;BYMONTH=3;BYDAY=TH",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
49
Recur: Monday of week number 20 (where the default start of the week is Monday), forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970512T090000;FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
48
Recur: Every 20th Monday of the year, forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970101T090000;FREQ=YEARLY;BYDAY=20MO",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
47
Recur: Every 3rd year on the 1st, 100th and 200th day for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970101T090000;FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
46
Recur: Every other year on January, February, and March for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970310T090000;FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
45
Recur: Yearly in June and July for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970610T090000;FREQ=YEARLY;COUNT=10;BYMONTH=6,7",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
44
Recur: Every Tuesday, every other month

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=MONTHLY;INTERVAL=2;BYDAY=TU",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
43
Recur: Every 18 months on the 10th thru 15th of the month for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970910T090000;FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
42
Recur: Monthly on the first and last day of the month for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970930T090000;FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
41
Recur: Monthly on the 2nd and 15th of the month for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
40
Recur: Monthly on the third to the last day of the month, forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970928T090000;FREQ=MONTHLY;BYMONTHDAY=-3",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
39
Recur: Monthly on the second to last Monday of the month for 6 months

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970922T090000;FREQ=MONTHLY;COUNT=6;BYDAY=-2MO",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
38
Recur: Every other month on the 1st and last Sunday of the month for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970907T090000;FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
37
Recur: Monthly on the 1st Friday until December 24, 1997

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970905T090000;FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
36
Recur: Monthly on the 1st Friday for ten occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970905T090000;FREQ=MONTHLY;COUNT=10;BYDAY=1FR",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
35
Recur: Every other week on Tuesday and Thursday, for 8 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
34
Recur: Every other week on Monday, Wednesday and Friday until December 24, 1997, but starting on Tuesday, September 2, 1997

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
33
Recur: Weekly on Tuesday and Thursday for 5 weeks

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
32
Recur: Weekly on Tuesday and Thursday for 5 weeks

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
31
Recur: Every other day - forever

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;INTERVAL=2",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
30
Recur: Daily until December 24, 1997

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;UNTIL=19971224T000000Z",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
29
Recur: Daily for 10 occurrences

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( Transform(oICalendar:RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;COUNT=10",12),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
28
How can I add a property of UTC offset type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("UTCOffset","+0100")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
27
How can I add a property of URI type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("URI","http://www.exontrol.com")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
26
How can I add a property of time type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Time1","12/30/1899 12:00:00")
			oComponent:Properties():Add("Time2",oICalendar:toICalendar(0.5,12/*exPropertyTypeTime*/))
			oProperty := oComponent:Properties():Add("Time3")
				oProperty:Value := 0.5
				oProperty:Type := 12/*exPropertyTypeTime*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
25
How can I add a property of text/string type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Text1","A1")
			oComponent:Properties():Add("Text2",oICalendar:toICalendar("A1",11/*exPropertyTypeText*/))
			oProperty := oComponent:Properties():Add("Text3")
				oProperty:Value := "A1"
				oProperty:Type := 11/*exPropertyTypeText*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
24
How can I find properties of recurence type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL p
	LOCAL i

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Recur","FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=SA,SU")
		p := oICalendar:Root:Properties:Item("Recur")
		i := oICalendar:toICalendar(p:Value(),p:GuessType())
		DevOut( "icalendar:" )
		DevOut( Transform(i,"") )
		DevOut( "all:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),""),"") )
		DevOut( "FREQ:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"FREQ"),"") )
		DevOut( "UNTIL:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"UNTIL"),"") )
		DevOut( "COUNT:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"COUNT"),"") )
		DevOut( "INTERVAL:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"INTERVAL"),"") )
		DevOut( "BYSECOND:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYSECOND"),"") )
		DevOut( "BYMINUTE:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYMINUTE"),"") )
		DevOut( "BYHOUR:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYHOUR"),"") )
		DevOut( "BYDAY:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYDAY"),"") )
		DevOut( "BYMONTHDAY:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYMONTHDAY"),"") )
		DevOut( "BYYEARDAY:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYYEARDAY"),"") )
		DevOut( "BYWEEKNO:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYWEEKNO"),"") )
		DevOut( "BYMONTH:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYMONTH"),"") )
		DevOut( "BYSETPOS:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"BYSETPOS"),"") )
		DevOut( "WKST:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"WKST"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
23
How can I add a property of recurrence type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Recur","FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
22
How can I find the duration in weeks, days, hours, minutes, seconds from a property of duration type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL p
	LOCAL i

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Period",oICalendar:valuesToICalendar("Start=#1/1/2001#;Duration=1",9/*exPropertyTypePeriod*/))
		p := oICalendar:Root:Properties:Item("Period")
		i := oICalendar:toICalendar(p:Value(),p:GuessType())
		DevOut( "icalendar:" )
		DevOut( Transform(i,"") )
		DevOut( "all:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),""),"") )
		DevOut( "start:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"Start"),"") )
		DevOut( "end:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"End"),"") )
		DevOut( "duration:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"Duration"),"") )
		DevOut( "weeks:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"W"),"") )
		DevOut( "days:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"D"),"") )
		DevOut( "hour:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"H"),"") )
		DevOut( "min:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"M"),"") )
		DevOut( "sec:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"S"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
21
How can I add a property of period type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Period1",oICalendar:valuesToICalendar("Start=#1/1/2001#;Duration=1",9/*exPropertyTypePeriod*/))
			oComponent:Properties():Add("Period2",oICalendar:valuesToICalendar("Start=#1/1/2001#;End=#1/2/2001#",9/*exPropertyTypePeriod*/))
			oComponent:Properties():Add("Period3",oICalendar:valuesToICalendar("Duration=1;End=#1/2/2001#",9/*exPropertyTypePeriod*/))
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
20
How can I add a property of integer type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Integer1",1)
			oComponent:Properties():Add("Integer2",oICalendar:toICalendar(1,8/*exPropertyTypeInteger*/))
			oProperty := oComponent:Properties():Add("Integer3")
				oProperty:Value := 1
				oProperty:Type := 8/*exPropertyTypeInteger*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
19
How can I add a property of float type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Float1",1.5)
			oComponent:Properties():Add("Float2",oICalendar:toICalendar(1.5,7/*exPropertyTypeFloat*/))
			oProperty := oComponent:Properties():Add("Float3")
				oProperty:Value := 1.5
				oProperty:Type := 7/*exPropertyTypeFloat*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
18
How do I get the type of the property

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty,oProperty1,oProperty2

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Duration1",oICalendar:toICalendar(2.5,6/*exPropertyTypeDuration*/))
			oProperty := oComponent:Properties():Add("Duration2")
				oProperty:Value := 2.5
				oProperty:Type := 6/*exPropertyTypeDuration*/
		oProperty1 := oICalendar:Root():Properties:Item("Duration1")
			DevOut( oProperty1:Name() )
			DevOut( "Guess" )
			DevOut( Transform(oProperty1:GuessType(),"") )
			DevOut( oProperty1:Name() )
			DevOut( "Type" )
			DevOut( Transform(oProperty1:Type(),"") )
		oProperty2 := oICalendar:Root():Properties:Item("Duration2")
			DevOut( oProperty2:Name() )
			DevOut( "Guess" )
			DevOut( Transform(oProperty2:GuessType(),"") )
			DevOut( oProperty2:Name() )
			DevOut( "Type" )
			DevOut( Transform(oProperty2:Type(),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
17
How can I get values of the duration iCalendar format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		DevOut( "all:" )
		DevOut( Transform(oICalendar:valuesFromICalendar("P1D",6/*exPropertyTypeDuration*/,""),"") )
		DevOut( "duration:" )
		DevOut( Transform(oICalendar:valuesFromICalendar("P1D",6/*exPropertyTypeDuration*/,"Duration"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
16
How can I find the duration in weeks, days, hours, minutes, seconds from a property of duration type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL p
	LOCAL i

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Duration",oICalendar:toICalendar(3.325,6/*exPropertyTypeDuration*/))
		p := oICalendar:Root:Properties:Item("Duration")
		i := oICalendar:toICalendar(p:Value(),p:GuessType())
		DevOut( "icalendar:" )
		DevOut( Transform(i,"") )
		DevOut( "all:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),""),"") )
		DevOut( "duration:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"Duration"),"") )
		DevOut( "weeks:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"W"),"") )
		DevOut( "days:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"D"),"") )
		DevOut( "hour:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"H"),"") )
		DevOut( "min:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"M"),"") )
		DevOut( "sec:" )
		DevOut( Transform(oICalendar:valuesFromICalendar(Transform(i,""),p:GuessType(),"S"),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
15
How can I add a property of duration type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Duration1",oICalendar:toICalendar(2.5,6/*exPropertyTypeDuration*/))
			oProperty := oComponent:Properties():Add("Duration2")
				oProperty:Value := 2.5
				oProperty:Type := 6/*exPropertyTypeDuration*/
			oComponent:Properties():Add("Duration3",oICalendar:valuesToICalendar("D=2;H=12",6/*exPropertyTypeDuration*/))
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
14
How can I add a property of date-time type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("DateTime1","01/01/2001 12:00:00")
			oComponent:Properties():Add("DateTime2",oICalendar:toICalendar("01/01/2001",5/*exPropertyTypeDateTime*/))
			oProperty := oComponent:Properties():Add("DateTime3")
				oProperty:Value := "01/01/2001"
				oProperty:Type := 5/*exPropertyTypeDateTime*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
13
How can I add a property of date type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Date1","01/01/2001")
			oComponent:Properties():Add("Date2",oICalendar:toICalendar("01/01/2001",4/*exPropertyTypeDate*/))
			oProperty := oComponent:Properties():Add("Date3")
				oProperty:Value := "01/01/2001"
				oProperty:Type := 4/*exPropertyTypeDate*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
12
How can I add a property of Calendar User Address type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("caladdress1","mailto:support@exontrol.com")
			oComponent:Properties():Add("caladdress2",oICalendar:toICalendar("mailto:support@exontrol.com",3/*exPropertyTypeCalAddress*/))
			oProperty := oComponent:Properties():Add("caladdress3")
				oProperty:Value := "mailto:support@exontrol.com"
				oProperty:Type := 3/*exPropertyTypeCalAddress*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
11
How can I add a property of boolean type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Boolean1",.T.)
			oComponent:Properties():Add("Boolean2",oICalendar:toICalendar("TRUE",2/*exPropertyTypeBoolean*/))
			oProperty := oComponent:Properties():Add("Boolean3")
				oProperty:Value := 0
				oProperty:Type := 2/*exPropertyTypeBoolean*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
10
How can I add a property of binary type

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperty

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oComponent:Properties():Add("Binary1",oICalendar:toICalendar("This is a bit of text converted to binary",1/*exPropertyTypeBinary*/))
			oProperty := oComponent:Properties():Add("Binary2")
				oProperty:Value := "This is a bit of text converted to binary"
				oProperty:Type := 1/*exPropertyTypeBinary*/
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
9
How can I access the root element of the iCalendar format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oICalendar:Load("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nEND:VCALENDAR")
		DevOut( oICalendar:Root:Name() )
		DevOut( Transform(oICalendar:Root:Properties:Item("Version"):Value(),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
8
How can I get notified once the control loads a new component, property, when using Load or LoadFile methods

PROCEDURE OnAddComponent(oICalendar,NewComponent)
	DevOut( Transform(NewComponent,"") )
RETURN

PROCEDURE OnAddProperty(oICalendar,NewPropery)
	DevOut( Transform(NewPropery,"") )
RETURN

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oICalendar:AddComponent := {|NewComponent| OnAddComponent(oICalendar,NewComponent)} /*Occurs when a new component is added.*/
		oICalendar:AddProperty := {|NewPropery| OnAddProperty(oICalendar,NewPropery)} /*Occurs when a new property is added.*/

		oICalendar:FireEvents := .T.
		oICalendar:Load("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nEND:VCALENDAR")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
7
How can I add a property with parameters

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperties

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oProperties := oComponent:Components():Add("VEVENT"):Properties()
				oProperties:Add("SUMMARY","Company Holiday Party"):Parameters():Add("LANGUAGE","en-US")
				oProperties:Add("DATE","01/01/2001")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
6
How can I load iCalendar from a string

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oICalendar:Load("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nEND:VCALENDAR")
		DevOut( oICalendar:Content:Components:Item(0):Name() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
5
How can I add VEVENT objects

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperties,oProperties1,oProperties2

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oProperties := oComponent:Properties()
				oProperties:Add("Version","2.0")
				oProperties:Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
			oProperties1 := oComponent:Components():Add("VEVENT"):Properties()
				oProperties1:Add("DTSTART","01/01/2001")
				oProperties1:Add("DTEND","01/02/2001")
				oProperties1:Add("SUMMARY","First Party")
			oProperties2 := oComponent:Components():Add("VEVENT"):Properties()
				oProperties2:Add("DTSTART","01/04/2001")
				oProperties2:Add("DTEND","01/05/2001")
				oProperties2:Add("SUMMARY","Second Party")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
4
How can I save the control's content to iCalendar format, as a file
#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperties,oProperties1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oProperties := oComponent:Properties()
				oProperties:Add("Version","2.0")
				oProperties:Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
			oProperties1 := oComponent:Components():Add("VEVENT"):Properties()
				oProperties1:Add("DTSTART","01/01/2001")
				oProperties1:Add("DTEND","01/02/2001")
				oProperties1:Add("SUMMARY","Bastille Day Party")
		oICalendar:SaveFile("c:/temp/test.ical")

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
3
How can I load the iCalendar format from a file

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oICalendar:LoadFile("c:/temp/test.ical")
		DevOut( Transform(oICalendar:Content:Components:Item("VCALENDAR"):Properties:Item("PRODID"):Value(),"") )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
2
How do I export the control's content to iCalendar format

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oComponent
	LOCAL oProperties,oProperties1

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oComponent := oICalendar:Content():Components():Add("VCALENDAR")
			oProperties := oComponent:Properties()
				oProperties:Add("Version","2.0")
				oProperties:Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
			oProperties1 := oComponent:Components():Add("VEVENT"):Properties()
				oProperties1:Add("DTSTART","01/01/2001")
				oProperties1:Add("DTEND","01/02/2001")
				oProperties1:Add("SUMMARY","Bastille Day Party")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN
1
How can I generate a VCALENDAR object

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oICalendar
	LOCAL oProperties

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oICalendar := XbpActiveXControl():new( oForm:drawingArea )
	oICalendar:CLSID  := "Exontrol.ICalendar.1" /*{D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6}*/
	oICalendar:create(,, {10,60},{610,370} )

		oProperties := oICalendar:Content():Components():Add("VCALENDAR"):Properties()
			oProperties:Add("Version","2.0")
			oProperties:Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
		DevOut( oICalendar:Save() )

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN