Changeset 208 for Include/com/variant.ab
- Timestamp:
- Apr 7, 2007, 10:20:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/com/variant.ab
r200 r208 156 156 Variant.Move(Detach, v) 157 157 End Function 158 158 /* 159 Static Function Assgin(ByRef from As VARIANT) As Variant 160 Assign = New Variant 161 Assgin.Assign(from) 162 End Function 163 164 Static Function Attach(ByRef from As VARIANT) As Variant 165 Attach = New Variant 166 Attach.Attach(from) 167 End Function 168 */ 159 169 'Operators 160 170 161 171 Const Function Operator ^(y As Variant) As Variant 162 Dim ret AsVariant172 Dim ret = New Variant 163 173 VarPow(This.v, y.v, ret.v) 164 174 Return ret … … 170 180 171 181 Const Function Operator -() As Variant 172 Dim ret AsVariant182 Dim ret = New Variant 173 183 VarNeg(This.v, ret.v) 174 184 Return ret … … 176 186 177 187 Const Function Operator *(y As Variant) As Variant 178 Dim ret AsVariant188 Dim ret = New Variant 179 189 VarMul(This.v, y.v, ret.v) 180 190 Return ret … … 182 192 183 193 Const Function Operator /(y As Variant) As Variant 184 Dim ret AsVariant194 Dim ret = New Variant 185 195 VarDiv(This.v, y.v, ret.v) 186 196 Return ret … … 188 198 189 199 Const Function Operator \(y As Variant) As Variant 190 Dim ret AsVariant200 Dim ret = New Variant 191 201 VarIDiv(This.v, y.v, ret.v) 192 202 Return ret … … 194 204 195 205 Const Function Operator Mod(y As Variant) As Variant 196 Dim ret AsVariant206 Dim ret = New Variant 197 207 VarMod(This.v, y.v, ret.v) 198 208 Return ret … … 200 210 201 211 Const Function Operator +(y As Variant) As Variant 202 Dim ret AsVariant212 Dim ret = New Variant 203 213 VarAdd(This.v, y.v, ret.v) 204 214 Return ret … … 206 216 207 217 Const Function Operator -(y As Variant) As Variant 208 Dim ret AsVariant218 Dim ret = New Variant 209 219 VarSub(This.v, y.v, ret.v) 210 220 Return ret … … 212 222 213 223 Const Function Operator &(y As Variant) As Variant 214 Dim ret AsVariant224 Dim ret = New Variant 215 225 VarCat(This.v, y.v, ret.v) 216 226 Return ret … … 218 228 219 229 Const Function Operator And(y As Variant) As Variant 220 Dim ret AsVariant230 Dim ret = New Variant 221 231 VarAnd(This.v, y.v, ret.v) 222 232 Return ret … … 224 234 225 235 Const Function Operator Or(y As Variant) As Variant 226 Dim ret AsVariant236 Dim ret = New Variant 227 237 VarOr(This.v, y.v, ret.v) 228 238 Return ret … … 230 240 231 241 Const Function Operator Xor(y As Variant) As Variant 232 Dim ret AsVariant242 Dim ret = New Variant 233 243 VarXor(This.v, y.v, ret.v) 234 244 Return ret … … 236 246 237 247 Const Function Operator Not() As Variant 238 Dim ret AsVariant248 Dim ret = New Variant 239 249 VarNot(This.v, ret.v) 240 250 Return ret … … 242 252 243 253 Static Function Imp(x As Variant, y As Variant) As Variant 244 Dim ret AsVariant254 Dim ret = New Variant 245 255 VarImp(x.v, y.v, ret.v) 246 256 Return ret … … 248 258 249 259 Static Function Eqv(x As Variant, y As Variant) As Variant 250 Dim ret AsVariant260 Dim ret = New Variant 251 261 VarEqv(x.v, y.v, ret.v) 252 262 Return ret … … 254 264 255 265 Const Function Abs() As Variant 256 Dim ret AsVariant266 Dim ret = New Variant 257 267 VarAbs(This.v, ret.v) 258 268 Return ret … … 260 270 261 271 Const Function Fix() As Variant 262 Dim ret AsVariant272 Dim ret = New Variant 263 273 VarFix(This.v, ret.v) 264 274 Return ret … … 266 276 267 277 Const Function Int() As Variant 268 Dim ret AsVariant278 Dim ret = New Variant 269 279 VarInt(This.v, ret.v) 270 280 Return ret … … 272 282 273 283 Const Function Round(cDecimals As Long) As Variant 274 Dim ret AsVariant284 Dim ret = New Variant 275 285 VarRound(This.v, cDecimals, ret) 276 286 Return ret … … 286 296 287 297 Static Function Compare(x As Variant, y As Variant) As HRESULT 288 Return VarCmp(x.v, y.v, GetUserDefaultLCID(), 0) 'VARCMP_NULL = 3を返す場合があるので注意298 Return VarCmp(x.v, y.v, LOCALE_USER_DEFAULT, 0) 'VARCMP_NULL = 3を返す場合があるので注意 289 299 End Function 290 300 … … 344 354 345 355 Const Function ChangeType(vt As VARTYPE, flags As Word) As Variant 346 Dim ret AsVariant356 Dim ret = New Variant 347 357 ChangeType(ret, flags, vt) 348 358 Return ret … … 368 378 Dim tmp = ChangeType(VT_BSTR) 369 379 Dim bs = ((tmp.v.val As ULONG_PTR) As BSTR) 370 Dim s As String(bs As PCWSTR, SysStringLen(bs) As Long) 371 Return s 380 Return New String(bs As PCWSTR, SysStringLen(bs) As Long) 372 381 End Function 373 382 … … 520 529 Dim r As VARIANT 521 530 ChangeType(r, 0, VT_BSTR) 522 Dim bs AsBString531 Dim bs = New BString 523 532 bs.Attach(GetPointer(VarPtr(r.val)) As BSTR) 524 533 Return bs … … 528 537 Clear() 529 538 v.vt = VT_BSTR 539 SetPointer(VarPtr(v.val), x.Copy()) 530 540 End Sub 531 541 … … 588 598 End Class 589 599 590 Dim _System_VariantOptionalParam = Nothing As Variant600 'Dim _System_VariantOptionalParam = Nothing As Variant 591 601 592 602 /*
Note:
See TracChangeset
for help on using the changeset viewer.