property ICalendar.valuesFromICalendar (Value as String, Type as PropertyTypeEnum, Parameter as String) as Variant
Extracts all values or specified value of the giving value in ICalendar format. For instance valuesFromICalendar("P15DT12H", exPropertyTypeDuration, "Duration") returns 15.5, which indicates the duration in days, hours, minutes, seconds as a DATE expression.

TypeDescription
Value as String A String expression to retrieve values from
Type as PropertyTypeEnum A PropertyTypeEnum expression that indicates the type of the Value
Parameter as String A String expression that specifies the Parameter whose value is to be requested. If Parameter is "" ( empty string ), the valuesFromICalendar property returns all known parameters with their values. 
Variant A VARIANT expression that specifies the requested value for giving parameter.
The valuesFromICalendar property returns values for known parameters of the giving expression ( available for exPropertyTypeDuration, exPropertyTypePeriod and exPropertyTypeRecur types as explained bellow ). The fromICalendar property converts the ICalendar value to a VARIANT expression. The toICalendar property is the reverse function, so it converts a VARIANT expression back to iCalendar format.

The valuesFromICalendar property is available for following types:

The following samples show how can you can find the duration in weeks, days, hours, minutes, seconds from a property of duration type.

Having the "P3DT7H48M" iCalendar format for duration it includes:

all: -=0;D=3;Duration=3.325;H=7;M=48;S=0;W=0
duration: 3.325
weeks: 0
days: 3
hour: 7
min: 48
sec: 0

VBA (MS Access, Excell...)

Set ICalendar1 = CreateObject("Exontrol.ICalendar.1")
With ICalendar1
	With .Content.Components.Add("VCALENDAR")
		.Properties.Add "Duration",ICalendar1.toICalendar(3.325,6)
	End With
	Set p = .Root.Properties.Item("Duration")
	i = .toICalendar(p.Value,p.GuessType) ' p.GuessType
	Debug.Print( "icalendar:" )
	Debug.Print( i )
	Debug.Print( "all:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"") ) ' p.GuessType
	Debug.Print( "duration:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"Duration") ) ' p.GuessType
	Debug.Print( "weeks:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"W") ) ' p.GuessType
	Debug.Print( "days:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"D") ) ' p.GuessType
	Debug.Print( "hour:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"H") ) ' p.GuessType
	Debug.Print( "min:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"M") ) ' p.GuessType
	Debug.Print( "sec:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"S") ) ' p.GuessType
End With

VB6

Set ICalendar1 = CreateObject("Exontrol.ICalendar.1")
With ICalendar1
	With .Content.Components.Add("VCALENDAR")
		.Properties.Add "Duration",ICalendar1.toICalendar(3.325,exPropertyTypeDuration)
	End With
	Set p = .Root.Properties.Item("Duration")
	i = .toICalendar(p.Value,p.GuessType)
	Debug.Print( "icalendar:" )
	Debug.Print( i )
	Debug.Print( "all:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"") )
	Debug.Print( "duration:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"Duration") )
	Debug.Print( "weeks:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"W") )
	Debug.Print( "days:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"D") )
	Debug.Print( "hour:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"H") )
	Debug.Print( "min:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"M") )
	Debug.Print( "sec:" )
	Debug.Print( .valuesFromICalendar(i,p.GuessType,"S") )
End With

VB.NET

' Add 'exontrol.exicalendar.dll(ExICalendar.dll)' reference to your project.
Exicalendar1 = New exontrol.EXICALENDARLib.exicalendar()
Dim i,p
With Exicalendar1
	With .Content.Components.Add("VCALENDAR")
		.Properties.Add("Duration",Exicalendar1.get_toICalendar(3.325,exontrol.EXICALENDARLib.PropertyTypeEnum.exPropertyTypeDuration))
	End With
	p = .Root.Properties.Item("Duration")
	i = .get_toICalendar(p.Value,p.GuessType)
	Debug.Print( "icalendar:" )
	Debug.Print( i )
	Debug.Print( "all:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"") )
	Debug.Print( "duration:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"Duration") )
	Debug.Print( "weeks:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"W") )
	Debug.Print( "days:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"D") )
	Debug.Print( "hour:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"H") )
	Debug.Print( "min:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"M") )
	Debug.Print( "sec:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"S") )
End With

VB.NET for /COM

AxICalendar1 = CreateObject("Exontrol.ICalendar.1")
Dim i,p
With AxICalendar1
	With .Content.Components.Add("VCALENDAR")
		.Properties.Add("Duration",AxICalendar1.toICalendar(3.325,EXICALENDARLib.PropertyTypeEnum.exPropertyTypeDuration))
	End With
	p = .Root.Properties.Item("Duration")
	i = .get_toICalendar(p.Value,p.GuessType)
	Debug.Print( "icalendar:" )
	Debug.Print( i )
	Debug.Print( "all:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"") )
	Debug.Print( "duration:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"Duration") )
	Debug.Print( "weeks:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"W") )
	Debug.Print( "days:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"D") )
	Debug.Print( "hour:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"H") )
	Debug.Print( "min:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"M") )
	Debug.Print( "sec:" )
	Debug.Print( .get_valuesFromICalendar(i,p.GuessType,"S") )
End With

C++

/*
	Includes the definition for CreateObject function like follows:

	#include <comdef.h>
	IUnknownPtr CreateObject( BSTR Object )
	{
		IUnknownPtr spResult;
		spResult.CreateInstance( Object );
		return spResult;
	};

*/
/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXICALENDARLib' for the library: 'ICalendar 1.0 Type Library'

	#import <ExICalendar.dll>
	using namespace EXICALENDARLib;
*/
EXICALENDARLib::IICalendarPtr spICalendar1 = ::CreateObject(L"Exontrol.ICalendar.1");
EXICALENDARLib::IComponentPtr var_Component = spICalendar1->GetContent()->GetComponents()->Add(L"VCALENDAR");
	var_Component->GetProperties()->Add(L"Duration",spICalendar1->GettoICalendar(double(3.325),EXICALENDARLib::exPropertyTypeDuration));
EXICALENDARLib::IPropertyPtr p = spICalendar1->GetRoot()->GetProperties()->GetItem("Duration");
_bstr_t i = spICalendar1->GettoICalendar(p->GetValue(),p->GetGuessType());
OutputDebugStringW( L"icalendar:" );
OutputDebugStringW( L"i" );
OutputDebugStringW( L"all:" );
OutputDebugStringW( _bstr_t(spICalendar1->GetvaluesFromICalendar(L"i",p->GetGuessType(),L"")) );
OutputDebugStringW( L"duration:" );
OutputDebugStringW( _bstr_t(spICalendar1->GetvaluesFromICalendar(L"i",p->GetGuessType(),L"Duration")) );
OutputDebugStringW( L"weeks:" );
OutputDebugStringW( _bstr_t(spICalendar1->GetvaluesFromICalendar(L"i",p->GetGuessType(),L"W")) );
OutputDebugStringW( L"days:" );
OutputDebugStringW( _bstr_t(spICalendar1->GetvaluesFromICalendar(L"i",p->GetGuessType(),L"D")) );
OutputDebugStringW( L"hour:" );
OutputDebugStringW( _bstr_t(spICalendar1->GetvaluesFromICalendar(L"i",p->GetGuessType(),L"H")) );
OutputDebugStringW( L"min:" );
OutputDebugStringW( _bstr_t(spICalendar1->GetvaluesFromICalendar(L"i",p->GetGuessType(),L"M")) );
OutputDebugStringW( L"sec:" );
OutputDebugStringW( _bstr_t(spICalendar1->GetvaluesFromICalendar(L"i",p->GetGuessType(),L"S")) );

C++ Builder

Exicalendarlib_tlb::IICalendarPtr ICalendar1 = Variant::CreateObject(L"Exontrol.ICalendar.1");
Exicalendarlib_tlb::IComponentPtr var_Component = ICalendar1->Content->Components->Add(L"VCALENDAR");
	var_Component->Properties->Add(L"Duration",TVariant(ICalendar1->get_toICalendar(TVariant(3.325),Exicalendarlib_tlb::PropertyTypeEnum::exPropertyTypeDuration)));
Exicalendarlib_tlb::IPropertyPtr p = ICalendar1->Root->Properties->get_Item(TVariant("Duration"));
String i = ICalendar1->toICalendar[TVariant(p->get_Value()),p->GuessType];
OutputDebugString( L"icalendar:" );
OutputDebugString( L"i" );
OutputDebugString( L"all:" );
OutputDebugString( PChar(ICalendar1->valuesFromICalendar[L"i",p->GuessType,L""]) );
OutputDebugString( L"duration:" );
OutputDebugString( PChar(ICalendar1->valuesFromICalendar[L"i",p->GuessType,L"Duration"]) );
OutputDebugString( L"weeks:" );
OutputDebugString( PChar(ICalendar1->valuesFromICalendar[L"i",p->GuessType,L"W"]) );
OutputDebugString( L"days:" );
OutputDebugString( PChar(ICalendar1->valuesFromICalendar[L"i",p->GuessType,L"D"]) );
OutputDebugString( L"hour:" );
OutputDebugString( PChar(ICalendar1->valuesFromICalendar[L"i",p->GuessType,L"H"]) );
OutputDebugString( L"min:" );
OutputDebugString( PChar(ICalendar1->valuesFromICalendar[L"i",p->GuessType,L"M"]) );
OutputDebugString( L"sec:" );
OutputDebugString( PChar(ICalendar1->valuesFromICalendar[L"i",p->GuessType,L"S"]) );

C#

// Add 'exontrol.exicalendar.dll(ExICalendar.dll)' reference to your project.
exontrol.EXICALENDARLib.exicalendar exicalendar1 = new exontrol.EXICALENDARLib.exicalendar();
exontrol.EXICALENDARLib.Component var_Component = exicalendar1.Content.Components.Add("VCALENDAR");
	var_Component.Properties.Add("Duration",exicalendar1.get_toICalendar(3.325,exontrol.EXICALENDARLib.PropertyTypeEnum.exPropertyTypeDuration));
exontrol.EXICALENDARLib.Property p = exicalendar1.Root.Properties["Duration"];
string i = exicalendar1.get_toICalendar(p.Value,p.GuessType);
System.Diagnostics.Debug.Print( "icalendar:" );
System.Diagnostics.Debug.Print( i.ToString() );
System.Diagnostics.Debug.Print( "all:" );
System.Diagnostics.Debug.Print( exicalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"").ToString() );
System.Diagnostics.Debug.Print( "duration:" );
System.Diagnostics.Debug.Print( exicalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"Duration").ToString() );
System.Diagnostics.Debug.Print( "weeks:" );
System.Diagnostics.Debug.Print( exicalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"W").ToString() );
System.Diagnostics.Debug.Print( "days:" );
System.Diagnostics.Debug.Print( exicalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"D").ToString() );
System.Diagnostics.Debug.Print( "hour:" );
System.Diagnostics.Debug.Print( exicalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"H").ToString() );
System.Diagnostics.Debug.Print( "min:" );
System.Diagnostics.Debug.Print( exicalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"M").ToString() );
System.Diagnostics.Debug.Print( "sec:" );
System.Diagnostics.Debug.Print( exicalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"S").ToString() );

JScript/JavaScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6" id="ICalendar1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	var var_Component = ICalendar1.Content.Components.Add("VCALENDAR");
		var_Component.Properties.Add("Duration",ICalendar1.toICalendar(3.325,6));
	var p = ICalendar1.Root.Properties.Item("Duration");
	var i = ICalendar1.toICalendar(p.Value,p.GuessType);
	alert( "icalendar:" );
	alert( i );
	alert( "all:" );
	alert( ICalendar1.valuesFromICalendar(i,p.GuessType,"") );
	alert( "duration:" );
	alert( ICalendar1.valuesFromICalendar(i,p.GuessType,"Duration") );
	alert( "weeks:" );
	alert( ICalendar1.valuesFromICalendar(i,p.GuessType,"W") );
	alert( "days:" );
	alert( ICalendar1.valuesFromICalendar(i,p.GuessType,"D") );
	alert( "hour:" );
	alert( ICalendar1.valuesFromICalendar(i,p.GuessType,"H") );
	alert( "min:" );
	alert( ICalendar1.valuesFromICalendar(i,p.GuessType,"M") );
	alert( "sec:" );
	alert( ICalendar1.valuesFromICalendar(i,p.GuessType,"S") );
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:D6C87100-38E2-4ABB-8AC2-4C0097AEE2D6" id="ICalendar1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With ICalendar1
		With .Content.Components.Add("VCALENDAR")
			.Properties.Add "Duration",ICalendar1.toICalendar(3.325,6)
		End With
		Set p = .Root.Properties.Item("Duration")
		i = .toICalendar(p.Value,p.GuessType) ' p.GuessType
		alert( "icalendar:" )
		alert( i )
		alert( "all:" )
		alert( .valuesFromICalendar(i,p.GuessType,"") ) ' p.GuessType
		alert( "duration:" )
		alert( .valuesFromICalendar(i,p.GuessType,"Duration") ) ' p.GuessType
		alert( "weeks:" )
		alert( .valuesFromICalendar(i,p.GuessType,"W") ) ' p.GuessType
		alert( "days:" )
		alert( .valuesFromICalendar(i,p.GuessType,"D") ) ' p.GuessType
		alert( "hour:" )
		alert( .valuesFromICalendar(i,p.GuessType,"H") ) ' p.GuessType
		alert( "min:" )
		alert( .valuesFromICalendar(i,p.GuessType,"M") ) ' p.GuessType
		alert( "sec:" )
		alert( .valuesFromICalendar(i,p.GuessType,"S") ) ' p.GuessType
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

EXICALENDARLib.ICalendar axICalendar1 = new EXICALENDARLib.ICalendar();
EXICALENDARLib.Component var_Component = axICalendar1.Content.Components.Add("VCALENDAR");
	var_Component.Properties.Add("Duration",axICalendar1.get_toICalendar(3.325,EXICALENDARLib.PropertyTypeEnum.exPropertyTypeDuration));
EXICALENDARLib.Property p = axICalendar1.Root.Properties["Duration"];
string i = axICalendar1.get_toICalendar(p.Value,p.GuessType);
System.Diagnostics.Debug.Print( "icalendar:" );
System.Diagnostics.Debug.Print( i.ToString() );
System.Diagnostics.Debug.Print( "all:" );
System.Diagnostics.Debug.Print( axICalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"").ToString() );
System.Diagnostics.Debug.Print( "duration:" );
System.Diagnostics.Debug.Print( axICalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"Duration").ToString() );
System.Diagnostics.Debug.Print( "weeks:" );
System.Diagnostics.Debug.Print( axICalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"W").ToString() );
System.Diagnostics.Debug.Print( "days:" );
System.Diagnostics.Debug.Print( axICalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"D").ToString() );
System.Diagnostics.Debug.Print( "hour:" );
System.Diagnostics.Debug.Print( axICalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"H").ToString() );
System.Diagnostics.Debug.Print( "min:" );
System.Diagnostics.Debug.Print( axICalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"M").ToString() );
System.Diagnostics.Debug.Print( "sec:" );
System.Diagnostics.Debug.Print( axICalendar1.get_valuesFromICalendar(i.ToString(),p.GuessType,"S").ToString() );

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Component,com_Properties,com_exicalendar1,com_p;
	anytype exicalendar1,p,var_Component,var_Properties;
	str i;
	;

	super();

	// Add 'exicalendar.dll(ExICalendar.dll)' reference to your project.
	exicalendar1 = COM::createFromObject(new EXICALENDARLib.exicalendar()); com_exicalendar1 = exicalendar1;
	var_Component = COM::createFromObject(com_exicalendar1.Content().Components()).Add("VCALENDAR"); com_Component = var_Component;
		var_Properties = COM::createFromObject(com_Component.Properties()); com_Properties = var_Properties;
		com_Properties.Add("Duration",COMVariant::createFromStr(com_exicalendar1.toICalendar(COMVariant::createFromReal(3.325),6/*exPropertyTypeDuration*/)));
	p = COM::createFromObject(com_exicalendar1.Root().Properties()).Item("Duration"); com_p = p;
	i = com_exicalendar1.toICalendar(p.Value(),p.GuessType());
	print( "icalendar:" );
	print( i );
	print( "all:" );
	print( com_exicalendar1.valuesFromICalendar(i,p.GuessType(),"") );
	print( "duration:" );
	print( com_exicalendar1.valuesFromICalendar(i,p.GuessType(),"Duration") );
	print( "weeks:" );
	print( com_exicalendar1.valuesFromICalendar(i,p.GuessType(),"W") );
	print( "days:" );
	print( com_exicalendar1.valuesFromICalendar(i,p.GuessType(),"D") );
	print( "hour:" );
	print( com_exicalendar1.valuesFromICalendar(i,p.GuessType(),"H") );
	print( "min:" );
	print( com_exicalendar1.valuesFromICalendar(i,p.GuessType(),"M") );
	print( "sec:" );
	print( com_exicalendar1.valuesFromICalendar(i,p.GuessType(),"S") );
}

Delphi 8 (.NET only)

AxICalendar1 := (ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.ICalendar.1')) as EXICALENDARLib.ICalendar);
with AxICalendar1 do
begin
	with Content.Components.Add('VCALENDAR') do
	begin
		Properties.Add('Duration',TObject(AxICalendar1.toICalendar[TObject(3.325),EXICALENDARLib.PropertyTypeEnum.exPropertyTypeDuration]));
	end;
	p := Root.Properties.Item['Duration'];
	i := get_toICalendar(p.Value,p.GuessType);
	OutputDebugString( 'icalendar:' );
	OutputDebugString( i );
	OutputDebugString( 'all:' );
	OutputDebugString( get_valuesFromICalendar(i,p.GuessType,'') );
	OutputDebugString( 'duration:' );
	OutputDebugString( get_valuesFromICalendar(i,p.GuessType,'Duration') );
	OutputDebugString( 'weeks:' );
	OutputDebugString( get_valuesFromICalendar(i,p.GuessType,'W') );
	OutputDebugString( 'days:' );
	OutputDebugString( get_valuesFromICalendar(i,p.GuessType,'D') );
	OutputDebugString( 'hour:' );
	OutputDebugString( get_valuesFromICalendar(i,p.GuessType,'H') );
	OutputDebugString( 'min:' );
	OutputDebugString( get_valuesFromICalendar(i,p.GuessType,'M') );
	OutputDebugString( 'sec:' );
	OutputDebugString( get_valuesFromICalendar(i,p.GuessType,'S') );
end

Delphi (standard)

ICalendar1 := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.ICalendar.1'))) as EXICALENDARLib_TLB.ICalendar);
with ICalendar1 do
begin
	with Content.Components.Add('VCALENDAR') do
	begin
		Properties.Add('Duration',OleVariant(ICalendar1.toICalendar[OleVariant(3.325),EXICALENDARLib_TLB.exPropertyTypeDuration]));
	end;
	p := Root.Properties.Item['Duration'];
	i := toICalendar[p.Value,p.GuessType];
	OutputDebugString( 'icalendar:' );
	OutputDebugString( i );
	OutputDebugString( 'all:' );
	OutputDebugString( valuesFromICalendar[i,p.GuessType,''] );
	OutputDebugString( 'duration:' );
	OutputDebugString( valuesFromICalendar[i,p.GuessType,'Duration'] );
	OutputDebugString( 'weeks:' );
	OutputDebugString( valuesFromICalendar[i,p.GuessType,'W'] );
	OutputDebugString( 'days:' );
	OutputDebugString( valuesFromICalendar[i,p.GuessType,'D'] );
	OutputDebugString( 'hour:' );
	OutputDebugString( valuesFromICalendar[i,p.GuessType,'H'] );
	OutputDebugString( 'min:' );
	OutputDebugString( valuesFromICalendar[i,p.GuessType,'M'] );
	OutputDebugString( 'sec:' );
	OutputDebugString( valuesFromICalendar[i,p.GuessType,'S'] );
end

VFP

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

dBASE Plus

local i,oICalendar,p,var_Component

oICalendar = new OleAutoClient("Exontrol.ICalendar.1")

var_Component = oICalendar.Content.Components.Add("VCALENDAR")
	var_Component.Properties.Add("Duration",oICalendar.toICalendar(3.325,6))
p = oICalendar.Root.Properties.Item("Duration")
i = oICalendar.toICalendar(p.Value,p.GuessType)
? "icalendar:" 
? Str(i) 
? "all:" 
? Str(oICalendar.valuesFromICalendar(Str(i),p.GuessType,"")) 
? "duration:" 
? Str(oICalendar.valuesFromICalendar(Str(i),p.GuessType,"Duration")) 
? "weeks:" 
? Str(oICalendar.valuesFromICalendar(Str(i),p.GuessType,"W")) 
? "days:" 
? Str(oICalendar.valuesFromICalendar(Str(i),p.GuessType,"D")) 
? "hour:" 
? Str(oICalendar.valuesFromICalendar(Str(i),p.GuessType,"H")) 
? "min:" 
? Str(oICalendar.valuesFromICalendar(Str(i),p.GuessType,"M")) 
? "sec:" 
? Str(oICalendar.valuesFromICalendar(Str(i),p.GuessType,"S")) 

XBasic (Alpha Five)

Dim i as 
Dim oICalendar as P
Dim p as P
Dim var_Component as P

oICalendar = OLE.Create("Exontrol.ICalendar.1")

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

Visual Objects

local var_Component as IComponent
local p as IProperty
local i as USUAL

oDCOCX_Exontrol1 := IICalendar{"Exontrol.ICalendar.1"}
var_Component := oDCOCX_Exontrol1:Content:Components:Add("VCALENDAR")
	var_Component:Properties:Add("Duration",oDCOCX_Exontrol1:[toICalendar,3.325,exPropertyTypeDuration])
p := oDCOCX_Exontrol1:Root:Properties:[Item,"Duration"]
i := oDCOCX_Exontrol1:[toICalendar,p:Value,p:GuessType]
OutputDebugString(String2Psz( "icalendar:" ))
OutputDebugString(String2Psz( AsString(i) ))
OutputDebugString(String2Psz( "all:" ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:[valuesFromICalendar,AsString(i),p:GuessType,""]) ))
OutputDebugString(String2Psz( "duration:" ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:[valuesFromICalendar,AsString(i),p:GuessType,"Duration"]) ))
OutputDebugString(String2Psz( "weeks:" ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:[valuesFromICalendar,AsString(i),p:GuessType,"W"]) ))
OutputDebugString(String2Psz( "days:" ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:[valuesFromICalendar,AsString(i),p:GuessType,"D"]) ))
OutputDebugString(String2Psz( "hour:" ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:[valuesFromICalendar,AsString(i),p:GuessType,"H"]) ))
OutputDebugString(String2Psz( "min:" ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:[valuesFromICalendar,AsString(i),p:GuessType,"M"]) ))
OutputDebugString(String2Psz( "sec:" ))
OutputDebugString(String2Psz( AsString(oDCOCX_Exontrol1:[valuesFromICalendar,AsString(i),p:GuessType,"S"]) ))

PowerBuilder

OleObject oICalendar,p,var_Component
any i

oICalendar = CREATE OLEObject
oICalendar.ConnectToNewObject("Exontrol.ICalendar.1")

var_Component = oICalendar.Content.Components.Add("VCALENDAR")
	var_Component.Properties.Add("Duration",oICalendar.toICalendar(3.325,6))
p = oICalendar.Root.Properties.Item("Duration")
i = oICalendar.toICalendar(p.Value,p.GuessType)
MessageBox("Information",string( "icalendar:" ))
MessageBox("Information",string( String(i) ))
MessageBox("Information",string( "all:" ))
MessageBox("Information",string( String(oICalendar.valuesFromICalendar(String(i),p.GuessType,"")) ))
MessageBox("Information",string( "duration:" ))
MessageBox("Information",string( String(oICalendar.valuesFromICalendar(String(i),p.GuessType,"Duration")) ))
MessageBox("Information",string( "weeks:" ))
MessageBox("Information",string( String(oICalendar.valuesFromICalendar(String(i),p.GuessType,"W")) ))
MessageBox("Information",string( "days:" ))
MessageBox("Information",string( String(oICalendar.valuesFromICalendar(String(i),p.GuessType,"D")) ))
MessageBox("Information",string( "hour:" ))
MessageBox("Information",string( String(oICalendar.valuesFromICalendar(String(i),p.GuessType,"H")) ))
MessageBox("Information",string( "min:" ))
MessageBox("Information",string( String(oICalendar.valuesFromICalendar(String(i),p.GuessType,"M")) ))
MessageBox("Information",string( "sec:" ))
MessageBox("Information",string( String(oICalendar.valuesFromICalendar(String(i),p.GuessType,"S")) ))

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Variant oComICalendar1
	Get ComCreateObject "Exontrol.ICalendar.1" to oComICalendar1

	Variant voComponent
	Get ComContent to voComponent
	Handle hoComponent
	Get Create (RefClass(cComComponent)) to hoComponent
	Set pvComObject of hoComponent to voComponent
		Variant voComponents
		Get ComComponents of hoComponent to voComponents
		Handle hoComponents
		Get Create (RefClass(cComComponents)) to hoComponents
		Set pvComObject of hoComponents to voComponents
			Variant voComponent1
			Get ComAdd of hoComponents "VCALENDAR" to voComponent1
			Handle hoComponent1
			Get Create (RefClass(cComComponent)) to hoComponent1
			Set pvComObject of hoComponent1 to voComponent1
				Variant voProperties
				Get ComProperties of hoComponent1 to voProperties
				Handle hoProperties
				Get Create (RefClass(cComProperties)) to hoProperties
				Set pvComObject of hoProperties to voProperties
					Variant vValue
						Get ComtoICalendar 3.325 OLEexPropertyTypeDuration to vValue
					Get ComAdd of hoProperties "Duration" vValue to Nothing
				Send Destroy to hoProperties
			Send Destroy to hoComponent1
		Send Destroy to hoComponents
	Send Destroy to hoComponent
	Variant v
	Variant voComponent2
	Get ComRoot to voComponent2
	Handle hoComponent2
	Get Create (RefClass(cComComponent)) to hoComponent2
	Set pvComObject of hoComponent2 to voComponent2
		Variant voProperties1
		Get ComProperties of hoComponent2 to voProperties1
		Handle hoProperties1
		Get Create (RefClass(cComProperties)) to hoProperties1
		Set pvComObject of hoProperties1 to voProperties1
			Get ComItem of hoProperties1 "Duration" to v
		Send Destroy to hoProperties1
	Send Destroy to hoComponent2
	Variant p
	Move v to p
	Variant i
	Get ComtoICalendar p p to i
	Showln "icalendar:" i
	Showln "all:" (ComvaluesFromICalendar(Self,i,p,""))
	Showln "duration:" (ComvaluesFromICalendar(Self,i,p,"Duration"))
	Showln "weeks:" (ComvaluesFromICalendar(Self,i,p,"W"))
	Showln "days:" (ComvaluesFromICalendar(Self,i,p,"D"))
	Showln "hour:" (ComvaluesFromICalendar(Self,i,p,"H"))
	Showln "min:" (ComvaluesFromICalendar(Self,i,p,"M"))
	Showln "sec:" (ComvaluesFromICalendar(Self,i,p,"S"))
End_Procedure

XBase++

#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