69
How do I encode data as ICalendar format

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content
		with .Components.Add("VCALENDAR")
			.Properties.Add("VERSION","2.1").Parameters.Add("UNICODE",.toICalendar(thisform.ICalendar1.T.,2))
			.Properties.Add("TEXT","This is just a bit of text to be encoded.")
			.Properties.Add("BINARY",thisform.ICalendar1.toICalendar("This is just a bit of text to be encoded.",1))
			with .Components.Add("VEVENT")
				.Properties.Add("DTSTART",{^2001-1-1})
				.Properties.Add("DTEND",{^2001-1-2 10:00:00})
			endwith
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
68
How do I get the occurrences between giving start/end margins

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( "AsArray: " )
	DEBUGOUT( .RecurRange("DTSTART=19970310;FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3",{^2001-1-1},{^2002-1-1}) )
	DEBUGOUT( "AsString: " )
	DEBUGOUT( .RecurRangeAsString("DTSTART=19970310;FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3",{^2001-1-1},{^2002-1-1}) )
endwith
67
How do I get the value of specified part in the recurrence expression

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( "FREQ: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",0) )
	DEBUGOUT( "DTSTART: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",1) )
	DEBUGOUT( "UNTIL: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",2) )
	DEBUGOUT( "COUNT: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",3) )
	DEBUGOUT( "INTERVAL: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",4) )
	DEBUGOUT( "WKST: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",14) )
	DEBUGOUT( "BYDAY: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",8) )
	DEBUGOUT( "BYMONTHDAY: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",9) )
	DEBUGOUT( "BYYEARDAY: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",10) )
	DEBUGOUT( "BYWEEKNO: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",11) )
	DEBUGOUT( "BYMONTH: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",12) )
	DEBUGOUT( "BYSETPOS: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",13) )
	DEBUGOUT( "BYHOUR: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",7) )
	DEBUGOUT( "BYMINUTE: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",6) )
	DEBUGOUT( "BYSECOND: " )
	DEBUGOUT( .RecurPartValue("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",5) )
endwith
66
How do I check if the recurrence expression is syntactically correct (method 2)

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( "1.A) SyntaxError: " )
	DEBUGOUT( .RecurPartValue("DTSTART=20151205;FREQ=DAILY;BYDAY=MO",-1) )
	DEBUGOUT( "1.B) SyntaxErrorInfo: " )
	DEBUGOUT( .RecurPartValue("DTSTART=20151205;FREQ=DAILY;BYDAY=MO",-2) )
	DEBUGOUT( "2.A) SyntaxError: " )
	DEBUGOUT( .RecurPartValue("FREQ=DAILY;BYDAY=MO",-1) )
	DEBUGOUT( "2.B) SyntaxErrorInfo: " )
	DEBUGOUT( .RecurPartValue("FREQ=DAILY;BYDAY=MO",-2) )
endwith
65
How do I check if the recurrence expression is syntactically correct (method 1)

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( "1. If negative, the expression is incorrect" )
	DEBUGOUT( .RecurCheck("DTSTART=20151205;FREQ=DAILY;BYDAY=MO",{^2015-12-5}) )
	DEBUGOUT( "2. If negative, the expression is incorrect" )
	DEBUGOUT( .RecurCheck("junk",{^2001-1-1}) )
endwith
64
How do I check if a specified date match the giving recurrence

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( {^2015-12-5} )
	DEBUGOUT( .RecurCheck("DTSTART=20151205;FREQ=DAILY;BYDAY=MO",{^2015-12-5}) )
	DEBUGOUT( {^2015-12-7} )
	DEBUGOUT( .RecurCheck("DTSTART=20151205;FREQ=DAILY;BYDAY=MO",{^2015-12-7}) )
endwith
63
Recur: The 2nd to last weekday of the month

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970929;FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2",12) )
endwith
62
Recur: The 3rd instance into the month of one of Tuesday, Wednesday or Thursday, for the next 3 months

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970904;FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3",12) )
endwith
61
Recur: The last work day of the month

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970805;FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1",12) )
endwith
60
Recur: An example where the days generated makes a difference because of WKST (Sample 2)

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU",12) )
endwith
59
Recur: An example where the days generated makes a difference because of WKST (Sample 1)

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970805T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO",12) )
endwith
58
Recur: Every 20 minutes from 9:00 AM to 4:40 PM every day

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40",12) )
endwith
57
Recur: Every hour and a half for 4 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=MINUTELY;INTERVAL=90;COUNT=4",12) )
endwith
56
Recur: Every 15 minutes for 6 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=MINUTELY;INTERVAL=15;COUNT=6",12) )
endwith
55
Recur: Every 3 hours from 9:00 AM to 5:00 PM on a specific day

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z",12) )
endwith
54
Recur: Every four years, the first Tuesday after a Monday in November, forever (U.S. Presidential Election day)

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19961105T090000;FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8",12) )
endwith
53
Recur: The first Saturday that follows the first Sunday of the month, forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970913T090000;FREQ=MONTHLY;BYDAY=SA;BYMONTHDAY=7,8,9,10,11,12,13",12) )
endwith
52
Recur: Every Friday the 13th, forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13",12) )
endwith
51
Recur: Every Thursday, but only during June, July, and August, forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970605T090000;FREQ=YEARLY;BYDAY=TH;BYMONTH=6,7,8",12) )
endwith
50
Recur: Every Thursday in March, forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970313T090000;FREQ=YEARLY;BYMONTH=3;BYDAY=TH",12) )
endwith
49
Recur: Monday of week number 20 (where the default start of the week is Monday), forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970512T090000;FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO",12) )
endwith
48
Recur: Every 20th Monday of the year, forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970101T090000;FREQ=YEARLY;BYDAY=20MO",12) )
endwith
47
Recur: Every 3rd year on the 1st, 100th and 200th day for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970101T090000;FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200",12) )
endwith
46
Recur: Every other year on January, February, and March for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970310T090000;FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3",12) )
endwith
45
Recur: Yearly in June and July for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970610T090000;FREQ=YEARLY;COUNT=10;BYMONTH=6,7",12) )
endwith
44
Recur: Every Tuesday, every other month

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=MONTHLY;INTERVAL=2;BYDAY=TU",12) )
endwith
43
Recur: Every 18 months on the 10th thru 15th of the month for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970910T090000;FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15",12) )
endwith
42
Recur: Monthly on the first and last day of the month for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970930T090000;FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1",12) )
endwith
41
Recur: Monthly on the 2nd and 15th of the month for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15",12) )
endwith
40
Recur: Monthly on the third to the last day of the month, forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970928T090000;FREQ=MONTHLY;BYMONTHDAY=-3",12) )
endwith
39
Recur: Monthly on the second to last Monday of the month for 6 months

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970922T090000;FREQ=MONTHLY;COUNT=6;BYDAY=-2MO",12) )
endwith
38
Recur: Every other month on the 1st and last Sunday of the month for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970907T090000;FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU",12) )
endwith
37
Recur: Monthly on the 1st Friday until December 24, 1997

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970905T090000;FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR",12) )
endwith
36
Recur: Monthly on the 1st Friday for ten occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970905T090000;FREQ=MONTHLY;COUNT=10;BYDAY=1FR",12) )
endwith
35
Recur: Every other week on Tuesday and Thursday, for 8 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH",12) )
endwith
34
Recur: Every other week on Monday, Wednesday and Friday until December 24, 1997, but starting on Tuesday, September 2, 1997

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR",12) )
endwith
33
Recur: Weekly on Tuesday and Thursday for 5 weeks

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH",12) )
endwith
32
Recur: Weekly on Tuesday and Thursday for 5 weeks

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH",12) )
endwith
31
Recur: Every other day - forever

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;INTERVAL=2",12) )
endwith
30
Recur: Daily until December 24, 1997

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;UNTIL=19971224T000000Z",12) )
endwith
29
Recur: Daily for 10 occurrences

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( .RecurAllAsString("DTSTART=19970902T090000;FREQ=DAILY;COUNT=10",12) )
endwith
28
How can I add a property of UTC offset type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("UTCOffset","+0100")
	endwith
	DEBUGOUT( .Save )
endwith
27
How can I add a property of URI type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("URI","http://www.exontrol.com")
	endwith
	DEBUGOUT( .Save )
endwith
26
How can I add a property of time type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Time1",{^1899-12-30 12:00:00})
		.Properties.Add("Time2",thisform.ICalendar1.toICalendar(0.5,12))
		with .Properties.Add("Time3")
			.Value = 0.5
			.Type = 12
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
25
How can I add a property of text/string type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Text1","A1")
		.Properties.Add("Text2",thisform.ICalendar1.toICalendar("A1",11))
		with .Properties.Add("Text3")
			.Value = "A1"
			.Type = 11
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
24
How can I find properties of recurence type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Recur","FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=SA,SU")
	endwith
	p = .Root.Properties.Item("Recur")
	i = .toICalendar(p.Value,p.GuessType) && p.GuessType
	DEBUGOUT( "icalendar:" )
	DEBUGOUT( i )
	DEBUGOUT( "all:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"") ) && p.GuessType
	DEBUGOUT( "FREQ:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"FREQ") ) && p.GuessType
	DEBUGOUT( "UNTIL:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"UNTIL") ) && p.GuessType
	DEBUGOUT( "COUNT:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"COUNT") ) && p.GuessType
	DEBUGOUT( "INTERVAL:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"INTERVAL") ) && p.GuessType
	DEBUGOUT( "BYSECOND:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYSECOND") ) && p.GuessType
	DEBUGOUT( "BYMINUTE:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYMINUTE") ) && p.GuessType
	DEBUGOUT( "BYHOUR:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYHOUR") ) && p.GuessType
	DEBUGOUT( "BYDAY:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYDAY") ) && p.GuessType
	DEBUGOUT( "BYMONTHDAY:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYMONTHDAY") ) && p.GuessType
	DEBUGOUT( "BYYEARDAY:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYYEARDAY") ) && p.GuessType
	DEBUGOUT( "BYWEEKNO:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYWEEKNO") ) && p.GuessType
	DEBUGOUT( "BYMONTH:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYMONTH") ) && p.GuessType
	DEBUGOUT( "BYSETPOS:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"BYSETPOS") ) && p.GuessType
	DEBUGOUT( "WKST:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"WKST") ) && p.GuessType
endwith
23
How can I add a property of recurrence type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Recur","FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU")
	endwith
	DEBUGOUT( .Save )
endwith
22
How can I find the duration in weeks, days, hours, minutes, seconds from a property of duration type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Period",thisform.ICalendar1.valuesToICalendar("Start=#1/1/2001#;Duration=1",9))
	endwith
	p = .Root.Properties.Item("Period")
	i = .toICalendar(p.Value,p.GuessType) && p.GuessType
	DEBUGOUT( "icalendar:" )
	DEBUGOUT( i )
	DEBUGOUT( "all:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"") ) && p.GuessType
	DEBUGOUT( "start:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"Start") ) && p.GuessType
	DEBUGOUT( "end:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"End") ) && p.GuessType
	DEBUGOUT( "duration:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"Duration") ) && p.GuessType
	DEBUGOUT( "weeks:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"W") ) && p.GuessType
	DEBUGOUT( "days:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"D") ) && p.GuessType
	DEBUGOUT( "hour:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"H") ) && p.GuessType
	DEBUGOUT( "min:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"M") ) && p.GuessType
	DEBUGOUT( "sec:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"S") ) && p.GuessType
endwith
21
How can I add a property of period type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Period1",thisform.ICalendar1.valuesToICalendar("Start=#1/1/2001#;Duration=1",9))
		.Properties.Add("Period2",thisform.ICalendar1.valuesToICalendar("Start=#1/1/2001#;End=#1/2/2001#",9))
		.Properties.Add("Period3",thisform.ICalendar1.valuesToICalendar("Duration=1;End=#1/2/2001#",9))
	endwith
	DEBUGOUT( .Save )
endwith
20
How can I add a property of integer type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Integer1",1)
		.Properties.Add("Integer2",thisform.ICalendar1.toICalendar(1,8))
		with .Properties.Add("Integer3")
			.Value = 1
			.Type = 8
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
19
How can I add a property of float type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Float1",1.5)
		.Properties.Add("Float2",thisform.ICalendar1.toICalendar(1.5,7))
		with .Properties.Add("Float3")
			.Value = 1.5
			.Type = 7
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
18
How do I get the type of the property

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Duration1",thisform.ICalendar1.toICalendar(2.5,6))
		with .Properties.Add("Duration2")
			.Value = 2.5
			.Type = 6
		endwith
	endwith
	with .Root.Properties.Item("Duration1")
		DEBUGOUT( .Name )
		DEBUGOUT( "Guess" )
		DEBUGOUT( .GuessType )
		DEBUGOUT( .Name )
		DEBUGOUT( "Type" )
		DEBUGOUT( .Type )
	endwith
	with .Root.Properties.Item("Duration2")
		DEBUGOUT( .Name )
		DEBUGOUT( "Guess" )
		DEBUGOUT( .GuessType )
		DEBUGOUT( .Name )
		DEBUGOUT( "Type" )
		DEBUGOUT( .Type )
	endwith
endwith
17
How can I get values of the duration iCalendar format

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	DEBUGOUT( "all:" )
	DEBUGOUT( .valuesFromICalendar("P1D",6,"") )
	DEBUGOUT( "duration:" )
	DEBUGOUT( .valuesFromICalendar("P1D",6,"Duration") )
endwith
16
How can I find the duration in weeks, days, hours, minutes, seconds from a property of duration type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Duration",thisform.ICalendar1.toICalendar(3.325,6))
	endwith
	p = .Root.Properties.Item("Duration")
	i = .toICalendar(p.Value,p.GuessType) && p.GuessType
	DEBUGOUT( "icalendar:" )
	DEBUGOUT( i )
	DEBUGOUT( "all:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"") ) && p.GuessType
	DEBUGOUT( "duration:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"Duration") ) && p.GuessType
	DEBUGOUT( "weeks:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"W") ) && p.GuessType
	DEBUGOUT( "days:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"D") ) && p.GuessType
	DEBUGOUT( "hour:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"H") ) && p.GuessType
	DEBUGOUT( "min:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"M") ) && p.GuessType
	DEBUGOUT( "sec:" )
	DEBUGOUT( .valuesFromICalendar(i,p.GuessType,"S") ) && p.GuessType
endwith
15
How can I add a property of duration type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Duration1",thisform.ICalendar1.toICalendar(2.5,6))
		with .Properties.Add("Duration2")
			.Value = 2.5
			.Type = 6
		endwith
		.Properties.Add("Duration3",thisform.ICalendar1.valuesToICalendar("D=2;H=12",6))
	endwith
	DEBUGOUT( .Save )
endwith
14
How can I add a property of date-time type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("DateTime1",{^2001-1-1 12:00:00})
		.Properties.Add("DateTime2",thisform.ICalendar1.toICalendar({^2001-1-1},5))
		with .Properties.Add("DateTime3")
			.Value = {^2001-1-1}
			.Type = 5
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
13
How can I add a property of date type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Date1",{^2001-1-1})
		.Properties.Add("Date2",thisform.ICalendar1.toICalendar({^2001-1-1},4))
		with .Properties.Add("Date3")
			.Value = {^2001-1-1}
			.Type = 4
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
12
How can I add a property of Calendar User Address type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("caladdress1","mailto:support@exontrol.com")
		.Properties.Add("caladdress2",thisform.ICalendar1.toICalendar("mailto:support@exontrol.com",3))
		with .Properties.Add("caladdress3")
			.Value = "mailto:support@exontrol.com"
			.Type = 3
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
11
How can I add a property of boolean type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Boolean1",.T.)
		.Properties.Add("Boolean2",thisform.ICalendar1.toICalendar("TRUE",2))
		with .Properties.Add("Boolean3")
			.Value = 0
			.Type = 2
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
10
How can I add a property of binary type

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		.Properties.Add("Binary1",thisform.ICalendar1.toICalendar("This is a bit of text converted to binary",1))
		with .Properties.Add("Binary2")
			.Value = "This is a bit of text converted to binary"
			.Type = 1
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
9
How can I access the root element of the iCalendar format

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	.Load("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nEND:VCALENDAR")
	DEBUGOUT( .Root.Name )
	DEBUGOUT( .Root.Properties.Item("Version").Value )
endwith
8
How can I get notified once the control loads a new component, property, when using Load or LoadFile methods

*** AddComponent event - Occurs when a new component is added. ***
LPARAMETERS NewComponent
	with thisform.ICalendar1
		DEBUGOUT( NewComponent )
	endwith

*** AddProperty event - Occurs when a new property is added. ***
LPARAMETERS NewPropery
	with thisform.ICalendar1
			DEBUGOUT( NewPropery )
	endwith

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	.FireEvents = .T.
	.Load("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nEND:VCALENDAR")
endwith
7
How can I add a property with parameters

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		with .Components.Add("VEVENT").Properties
			.Add("SUMMARY","Company Holiday Party").Parameters.Add("LANGUAGE","en-US")
			.Add("DATE",{^2001-1-1})
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
6
How can I load iCalendar from a string

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	.Load("BEGIN:VCALENDAR\r\nVERSION:2.0\r\nEND:VCALENDAR")
	DEBUGOUT( .Content.Components.Item(0).Name )
endwith
5
How can I add VEVENT objects

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		with .Properties
			.Add("Version","2.0")
			.Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
		endwith
		with .Components.Add("VEVENT").Properties
			.Add("DTSTART",{^2001-1-1})
			.Add("DTEND",{^2001-1-2})
			.Add("SUMMARY","First Party")
		endwith
		with .Components.Add("VEVENT").Properties
			.Add("DTSTART",{^2001-1-4})
			.Add("DTEND",{^2001-1-5})
			.Add("SUMMARY","Second Party")
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
4
How can I save the control's content to iCalendar format, as a file
thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		with .Properties
			.Add("Version","2.0")
			.Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
		endwith
		with .Components.Add("VEVENT").Properties
			.Add("DTSTART",{^2001-1-1})
			.Add("DTEND",{^2001-1-2})
			.Add("SUMMARY","Bastille Day Party")
		endwith
	endwith
	.SaveFile("c:/temp/test.ical")
endwith
3
How can I load the iCalendar format from a file

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	.LoadFile("c:/temp/test.ical")
	DEBUGOUT( .Content.Components.Item("VCALENDAR").Properties.Item("PRODID").Value )
endwith
2
How do I export the control's content to iCalendar format

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR")
		with .Properties
			.Add("Version","2.0")
			.Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
		endwith
		with .Components.Add("VEVENT").Properties
			.Add("DTSTART",{^2001-1-1})
			.Add("DTEND",{^2001-1-2})
			.Add("SUMMARY","Bastille Day Party")
		endwith
	endwith
	DEBUGOUT( .Save )
endwith
1
How can I generate a VCALENDAR object

thisform.ICalendar1 = CreateObject("Exontrol.ICalendar.1")
with thisform.ICalendar1
	with .Content.Components.Add("VCALENDAR").Properties
		.Add("Version","2.0")
		.Add("PRODID","-//hacksw/handcal//NONSGML v1.0//EN")
	endwith
	DEBUGOUT( .Save )
endwith