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
50985fa2
Commit
50985fa2
authored
Oct 01, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Added Right() implementation.
parent
3e45fbcb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
global.c
dlls/vbscript/global.c
+35
-3
api.vbs
dlls/vbscript/tests/api.vbs
+10
-0
No files found.
dlls/vbscript/global.c
View file @
50985fa2
...
...
@@ -676,10 +676,42 @@ static HRESULT Global_LeftB(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VAR
return
E_NOTIMPL
;
}
static
HRESULT
Global_Right
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
static
HRESULT
Global_Right
(
vbdisp_t
*
This
,
VARIANT
*
arg
s
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
FIXME
(
"
\n
"
);
return
E_NOTIMPL
;
BSTR
str
,
ret
,
conv_str
=
NULL
;
int
len
,
str_len
;
HRESULT
hres
;
TRACE
(
"(%s %s)
\n
"
,
debugstr_variant
(
args
+
1
),
debugstr_variant
(
args
));
if
(
V_VT
(
args
+
1
)
==
VT_BSTR
)
{
str
=
V_BSTR
(
args
+
1
);
}
else
{
hres
=
to_string
(
args
+
1
,
&
conv_str
);
if
(
FAILED
(
hres
))
return
hres
;
str
=
conv_str
;
}
hres
=
to_int
(
args
,
&
len
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
len
<
0
)
{
FIXME
(
"len = %d
\n
"
,
len
);
return
E_FAIL
;
}
str_len
=
SysStringLen
(
str
);
if
(
len
>
str_len
)
len
=
str_len
;
ret
=
SysAllocStringLen
(
str
+
str_len
-
len
,
len
);
SysFreeString
(
conv_str
);
if
(
!
ret
)
return
E_OUTOFMEMORY
;
return
return_bstr
(
res
,
ret
);
}
static
HRESULT
Global_RightB
(
vbdisp_t
*
This
,
VARIANT
*
arg
,
unsigned
args_cnt
,
VARIANT
*
res
)
...
...
dlls/vbscript/tests/api.vbs
View file @
50985fa2
...
...
@@ -215,6 +215,16 @@ TestLeft "test", 0, ""
TestLeft
123
,
2
,
"12"
if
isEnglishLang
then
TestLeft
true
,
2
,
"Tr"
Sub
TestRight
(
str
,
len
,
ex
)
Call
ok
(
Right
(
str
,
len
)
=
ex
,
"Right("
&
str
&
", "
&
len
&
") = "
&
Right
(
str
,
len
))
End
Sub
TestRight
"test"
,
2
,
"st"
TestRight
"test"
,
5
,
"test"
TestRight
"test"
,
0
,
""
TestRight
123
,
2
,
"23"
if
isEnglishLang
then
TestRight
true
,
2
,
"ue"
Sub
TestRound
(
val
,
exval
,
vt
)
Call
ok
(
Round
(
val
)
=
exval
,
"Round("
&
val
&
") = "
&
Round
(
val
))
Call
ok
(
getVT
(
Round
(
val
))
=
vt
,
"getVT(Round("
&
val
&
")) = "
&
getVT
(
Round
(
val
)))
...
...
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