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
3fa78601
Commit
3fa78601
authored
Sep 18, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added Len implementation.
parent
20b2d057
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
global.c
dlls/vbscript/global.c
+22
-2
api.vbs
dlls/vbscript/tests/api.vbs
+6
-0
No files found.
dlls/vbscript/global.c
View file @
3fa78601
...
...
@@ -468,8 +468,28 @@ static HRESULT Global_RGB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
static
HRESULT
Global_Len
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
DWORD
len
;
HRESULT
hres
;
TRACE
(
"%s
\n
"
,
debugstr_variant
(
arg
));
if
(
V_VT
(
arg
)
==
VT_NULL
)
return
return_null
(
res
);
if
(
V_VT
(
arg
)
!=
VT_BSTR
)
{
BSTR
str
;
hres
=
to_string
(
arg
,
&
str
);
if
(
FAILED
(
hres
))
return
hres
;
len
=
SysStringLen
(
str
);
SysFreeString
(
str
);
}
else
{
len
=
SysStringLen
(
V_BSTR
(
arg
));
}
return
return_int
(
res
,
len
);
}
static
HRESULT
Global_LenB
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
3fa78601
...
...
@@ -173,4 +173,10 @@ TestLCase 0.123, doubleAsString(0.123)
TestLCase
Empty
,
""
Call
ok
(
getVT
(
LCase
(
Null
))
=
"VT_NULL"
,
"getVT(LCase(Null)) = "
&
getVT
(
LCase
(
Null
)))
Call
ok
(
Len
(
"abc"
)
=
3
,
"Len(abc) = "
&
Len
(
"abc"
))
Call
ok
(
Len
(
""
)
=
0
,
"Len() = "
&
Len
(
""
))
Call
ok
(
Len
(
1
)
=
1
,
"Len(1) = "
&
Len
(
1
))
Call
ok
(
isNull
(
Len
(
null
)),
"Len(null) = "
&
Len
(
null
))
Call
ok
(
Len
(
empty
)
=
0
,
"Len(empty) = "
&
Len
(
empty
))
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