Index: trunk/Include/com/variant.ab
===================================================================
--- trunk/Include/com/variant.ab	(revision 335)
+++ trunk/Include/com/variant.ab	(revision 355)
@@ -6,5 +6,5 @@
 '#require <oaidl.ab>
 '#require <oleauto.ab>
-#require <com/index.ab>
+'#require <com/index.ab>
 
 Namespace ActiveBasic
@@ -109,6 +109,5 @@
 
 	Sub Variant(s As String)
-		Dim bs As BString(s)
-		Variant(bs)
+		ValStr = New BString(s)
 	End Sub
 
@@ -118,4 +117,10 @@
 	End Sub
 
+	Sub Variant(n As Decimal)
+		Dim p = VarPtr(v) As *DECIMAL
+		p[0] = n.Dec
+		v.vt = VT_DECIMAL
+	End Sub
+
 
 	Sub ~Variant()
@@ -127,13 +132,5 @@
 		v.vt = VT_EMPTY
 	End Sub
-/*
-	Sub Operator =(y As Variant)
-		Assign(y.v)
-	End Sub
-
-	Sub Operator =(y As VARIANT)
-		Assign(y)
-	End Sub
-*/
+
 	Sub Assign(from As Variant)
 		Assign(from.v)
@@ -171,5 +168,5 @@
 */
 	'Operators
-
+/*
 	Const Function Operator ^(y As Variant) As Variant
 		Dim ret = New Variant
@@ -265,31 +262,23 @@
 		Return ret
 	End Function
-
+*/
 	Const Function Abs() As Variant
-		Dim ret = New Variant
-		VarAbs(This.v, ret.v)
-		Return ret
+		Abs = New Variant
+		VarAbs(This.v, Abs.v)
 	End Function
 
 	Const Function Fix() As Variant
-		Dim ret = New Variant
-		VarFix(This.v, ret.v)
-		Return ret
+		Fix = New Variant
+		VarFix(This.v, Fix.v)
 	End Function
 
 	Const Function Int() As Variant
-		Dim ret = New Variant
-		VarInt(This.v, ret.v)
-		Return ret
-	End Function
-
-	Const Function Round(cDecimals As Long) As Variant
-		Dim ret = New Variant
-		VarRound(This.v, cDecimals, ret)
-		Return ret
-	End Function
-
-	Const Function Round() As Variant
-		Return Round(0)
+		Int = New Variant
+		VarInt(This.v, Int.v)
+	End Function
+
+	Const Function Round(cDecimals = 0 As Long) As Variant
+		Round = New Variant
+		VarRound(This.v, cDecimals, Round.v)
 	End Function
 
@@ -301,5 +290,5 @@
 		Return VarCmp(x.v, y.v, LOCALE_USER_DEFAULT, 0) 'VARCMP_NULL = 3を返す場合があるので注意
 	End Function
-
+/*
 	Const Function Operator ==(y As Variant) As Boolean
 		Dim c = Compare(This, y)
@@ -338,4 +327,5 @@
 	End Function
 */
+/*
 	Const Function Operator <=(y As Variant) As Boolean
 		Dim c = Compare(This, y)
@@ -355,5 +345,5 @@
 		End If
 	End Function
-
+*/
 	Const Function ChangeType(vt As VARTYPE, flags As Word) As Variant
 		Dim ret = New Variant
@@ -435,5 +425,5 @@
 	Const Function ValI1() As SByte
 		Dim r = ChangeType(VT_I1)
-		Return GetByte(VarPtr(r.val)) As SByte
+		Return GetByte(VarPtr(r.v.val)) As SByte
 	End Function
 
@@ -446,5 +436,5 @@
 	Const Function ValI2() As Integer
 		Dim r = ChangeType(VT_I2)
-		Return GetWord(VarPtr(r.val)) As Integer
+		Return GetWord(VarPtr(r.v.val)) As Integer
 	End Function
 
@@ -457,5 +447,5 @@
 	Const Function ValI4() As Long
 		Dim r = ChangeType(VT_I4)
-		Return GetDWord(VarPtr(r.val)) As Long
+		Return GetDWord(VarPtr(r.v.val)) As Long
 	End Function
 
@@ -468,5 +458,5 @@
 	Const Function ValI8() As Int64
 		Dim r = ChangeType(VT_I8)
-		Return GetQWord(VarPtr(r.val)) As Int64
+		Return GetQWord(VarPtr(r.v.val)) As Int64
 	End Function
 
@@ -479,5 +469,5 @@
 	Const Function ValR4() As Single
 		Dim r = ChangeType(VT_R4)
-		Return GetSingle(VarPtr(r.val))
+		Return GetSingle(VarPtr(r.v.val))
 	End Function
 
@@ -490,5 +480,5 @@
 	Const Function ValR8() As Double
 		Dim r = ChangeType(VT_UI8)
-		Return GetDouble(VarPtr(r.val))
+		Return GetDouble(VarPtr(r.v.val))
 	End Function
 
@@ -512,5 +502,5 @@
 	Const Function ValError() As SCODE
 		Dim r = ChangeType(VT_ERROR)
-		Return GetDWord(VarPtr(r.val))
+		Return GetDWord(VarPtr(r.v.val))
 	End Function
 
@@ -524,5 +514,5 @@
 		Dim r = ChangeType(VT_CY)
 		ValCy = New Currency
-		ValCy.Cy = GetQWord(VarPtr(r.val))
+		ValCy.Cy = GetQWord(VarPtr(r.v.val))
 	End Function
 
@@ -561,5 +551,5 @@
 		v.vt = VT_UNKNOWN
 	End Sub
-
+/*
 	Const Function ValObject() As VBObject
 		Dim r As VARIANT
@@ -576,15 +566,15 @@
 		v.vt = VT_DISPATH
 	End Sub
-
+*/
 	'ValArray
 
 	Const Function ValDecimal() As Decimal
 		Dim p = VarPtr(v) As *Decimal
-		Return New Deciaml(p[0])
+		Return New Deciaml(ByVal p)
 	End Function
 
 	Sub ValDecimal(x As Decimal)
 		Clear()
-		Dim p = VarPtr(v) As *Decimal
+		Dim p = VarPtr(v) As *DECIMAL
 		p[0] = x.Dec
 		v.vt = VT_DECIMAL '念の為
@@ -599,8 +589,8 @@
 '		If _System_VariantOptionalParam = Nothing Then
 '			'ToDo マルチスレッド対応
-			_System_VariantOptionalParam = New Variant
-			_System_VariantOptionalParam.ValError = DISP_E_PARAMNOTFOUND
+			VariantOptionalParam = New Variant
+			VariantOptionalParam.ValError = DISP_E_PARAMNOTFOUND
 '		End If
-		Return _System_VariantOptionalParam
+		Return VariantOptionalParam
 	End Function
 Private
@@ -617,5 +607,5 @@
 End Class
 
-'Dim _System_VariantOptionalParam = Nothing As Variant
+Dim VariantOptionalParam = Nothing As Variant
 
 /*
