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
c9a606fa
Commit
c9a606fa
authored
Aug 21, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Add Asc implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6cc7b0e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
global.c
dlls/vbscript/global.c
+26
-2
api.vbs
dlls/vbscript/tests/api.vbs
+36
-0
No files found.
dlls/vbscript/global.c
View file @
c9a606fa
...
...
@@ -1371,8 +1371,32 @@ static HRESULT Global_ChrB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI
static
HRESULT
Global_Asc
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BSTR
conv_str
=
NULL
,
str
;
HRESULT
hres
=
S_OK
;
TRACE
(
"(%s)
\n
"
,
debugstr_variant
(
arg
));
switch
(
V_VT
(
arg
))
{
case
VT_NULL
:
return
MAKE_VBSERROR
(
VBSE_ILLEGAL_NULL_USE
);
case
VT_EMPTY
:
return
MAKE_VBSERROR
(
VBSE_ILLEGAL_FUNC_CALL
);
case
VT_BSTR
:
str
=
V_BSTR
(
arg
);
break
;
default:
hres
=
to_string
(
arg
,
&
conv_str
);
if
(
FAILED
(
hres
))
return
hres
;
str
=
conv_str
;
}
if
(
!
SysStringLen
(
str
)
||
*
str
>=
0x100
)
hres
=
MAKE_VBSERROR
(
VBSE_ILLEGAL_FUNC_CALL
);
else
if
(
res
)
hres
=
return_short
(
res
,
*
str
);
SysFreeString
(
conv_str
);
return
hres
;
}
/* The function supports only single-byte and double-byte character sets. It
...
...
dlls/vbscript/tests/api.vbs
View file @
c9a606fa
...
...
@@ -1453,4 +1453,40 @@ Call testRGBError(&h4d&, -2, &h2f&, 5)
Call
ok
(
getVT
(
Timer
)
=
"VT_R4"
,
"getVT(Timer) = "
&
getVT
(
Timer
))
sub
testAsc
(
arg
,
expected
)
dim
x
x
=
Asc
(
arg
)
call
ok
(
x
=
expected
,
"x = "
&
x
&
" expected "
&
expected
)
call
ok
(
getVT
(
x
)
=
"VT_I2*"
,
"getVT = "
&
getVT
(
x
))
end
sub
sub
testAscError
()
on
error
resume
next
call
Err
.
clear
()
call
Asc
(
null
)
Call
ok
(
Err
.
number
=
94
,
"Err.number = "
&
Err
.
number
)
call
Err
.
clear
()
call
Asc
(
empty
)
Call
ok
(
Err
.
number
=
5
,
"Err.number = "
&
Err
.
number
)
call
Err
.
clear
()
call
Asc
()
Call
ok
(
Err
.
number
=
450
,
"Err.number = "
&
Err
.
number
)
call
Err
.
clear
()
call
Asc
(
Chr
(
260
))
Call
ok
(
Err
.
number
=
5
,
"Err.number = "
&
Err
.
number
)
call
Err
.
clear
()
call
Asc
(
""
)
Call
ok
(
Err
.
number
=
5
,
"Err.number = "
&
Err
.
number
)
end
sub
call
testAsc
(
"T"
,
84
)
call
testAsc
(
"test"
,
116
)
call
testAsc
(
"3"
,
51
)
call
testAsc
(
3
,
51
)
call
testAsc
(
" "
,
32
)
call
testAsc
(
Chr
(
255
),
255
)
call
testAsc
(
Chr
(
0
),
0
)
if
isEnglishLang
then
testAsc
true
,
84
call
testAscError
()
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