Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
61d49a8a
Commit
61d49a8a
authored
Jun 25, 2014
by
Shuai Meng
Committed by
Alexandre Julliard
Jun 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Implemented TypeName.
parent
342eec7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
2 deletions
+58
-2
global.c
dlls/vbscript/global.c
+46
-2
api.vbs
dlls/vbscript/tests/api.vbs
+12
-0
No files found.
dlls/vbscript/global.c
View file @
61d49a8a
...
...
@@ -1502,8 +1502,52 @@ static HRESULT Global_DatePart(vbdisp_t *This, VARIANT *arg, unsigned args_cnt,
static
HRESULT
Global_TypeName
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
static
const
WCHAR
ByteW
[]
=
{
'B'
,
'y'
,
't'
,
'e'
,
0
};
static
const
WCHAR
IntegerW
[]
=
{
'I'
,
'n'
,
't'
,
'e'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
LongW
[]
=
{
'L'
,
'o'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
SingleW
[]
=
{
'S'
,
'i'
,
'n'
,
'g'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
DoubleW
[]
=
{
'D'
,
'o'
,
'u'
,
'b'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
CurrencyW
[]
=
{
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
'c'
,
'y'
,
0
};
static
const
WCHAR
DecimalW
[]
=
{
'D'
,
'e'
,
'c'
,
'i'
,
'm'
,
'a'
,
'l'
,
0
};
static
const
WCHAR
DateW
[]
=
{
'D'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
StringW
[]
=
{
'S'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
BooleanW
[]
=
{
'B'
,
'o'
,
'o'
,
'l'
,
'e'
,
'a'
,
'n'
,
0
};
static
const
WCHAR
EmptyW
[]
=
{
'E'
,
'm'
,
'p'
,
't'
,
'y'
,
0
};
static
const
WCHAR
NullW
[]
=
{
'N'
,
'u'
,
'l'
,
'l'
,
0
};
TRACE
(
"(%s)
\n
"
,
debugstr_variant
(
arg
));
assert
(
args_cnt
==
1
);
switch
(
V_VT
(
arg
))
{
case
VT_UI1
:
return
return_string
(
res
,
ByteW
);
case
VT_I2
:
return
return_string
(
res
,
IntegerW
);
case
VT_I4
:
return
return_string
(
res
,
LongW
);
case
VT_R4
:
return
return_string
(
res
,
SingleW
);
case
VT_R8
:
return
return_string
(
res
,
DoubleW
);
case
VT_CY
:
return
return_string
(
res
,
CurrencyW
);
case
VT_DECIMAL
:
return
return_string
(
res
,
DecimalW
);
case
VT_DATE
:
return
return_string
(
res
,
DateW
);
case
VT_BSTR
:
return
return_string
(
res
,
StringW
);
case
VT_BOOL
:
return
return_string
(
res
,
BooleanW
);
case
VT_EMPTY
:
return
return_string
(
res
,
EmptyW
);
case
VT_NULL
:
return
return_string
(
res
,
NullW
);
default:
FIXME
(
"arg %s not supported
\n
"
,
debugstr_variant
(
arg
));
return
E_NOTIMPL
;
}
}
static
HRESULT
Global_Array
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
61d49a8a
...
...
@@ -845,4 +845,16 @@ MyObject.myval = 0
Call
ok
(
CSng
(
MyObject
)
=
0
,
"CSng(MyObject) = "
&
CSng
(
MyObject
))
Call
ok
(
getVT
(
CSng
(
MyObject
))
=
"VT_R4"
,
"getVT(CSng(MyObject)) = "
&
getVT
(
CSng
(
MyObject
)))
Dim
MyEmpty
Call
ok
(
TypeName
(
CByte
(
255
))
=
"Byte"
,
"TypeName(CByte(255)) = "
&
TypeName
(
CByte
(
255
)))
Call
ok
(
TypeName
(
255
)
=
"Integer"
,
"TypeName(255) = "
&
TypeName
(
255
))
Call
ok
(
TypeName
(
32768
)
=
"Long"
,
"TypeName(32768) = "
&
TypeName
(
32768
))
Call
ok
(
TypeName
(
CSng
(
0.5
))
=
"Single"
,
"TypeName(CSng(0.5)) = "
&
TypeName
(
CSng
(
0.5
)))
Call
ok
(
TypeName
(
-
0.5
)
=
"Double"
,
"TypeName(-0.5) = "
&
TypeName
(
-
0.5
))
Call
ok
(
TypeName
(
CCur
(
0.5
))
=
"Currency"
,
"TypeName(CCur(0.5)) = "
&
TypeName
(
CCur
(
0.5
)))
Call
ok
(
TypeName
(
CStr
(
0.5
))
=
"String"
,
"TypeName(CStr(0.5)) = "
&
TypeName
(
CStr
(
0.5
)))
Call
ok
(
TypeName
(
True
)
=
"Boolean"
,
"TypeName(True) = "
&
TypeName
(
True
))
Call
ok
(
TypeName
(
MyEmpty
)
=
"Empty"
,
"TypeName(MyEmpty) = "
&
TypeName
(
Empty
))
Call
ok
(
TypeName
(
Null
)
=
"Null"
,
"TypeName(Null) = "
&
TypeName
(
Null
))
Call
reportSuccess
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment