Commit 324aadd2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Added interp_sub implementation.

parent 03c82848
......@@ -417,8 +417,26 @@ static HRESULT interp_add(exec_ctx_t *ctx)
static HRESULT interp_sub(exec_ctx_t *ctx)
{
FIXME("\n");
return E_NOTIMPL;
variant_val_t r, l;
VARIANT v;
HRESULT hres;
TRACE("\n");
hres = stack_pop_val(ctx, &r);
if(FAILED(hres))
return hres;
hres = stack_pop_val(ctx, &l);
if(SUCCEEDED(hres)) {
hres = VarSub(l.v, r.v, &v);
release_val(&l);
}
release_val(&r);
if(FAILED(hres))
return hres;
return stack_push(ctx, &v);
}
static HRESULT interp_neg(exec_ctx_t *ctx)
......
......@@ -75,4 +75,9 @@ Call ok(false + 6 + true = 5, "false + 6 + true <> 5")
Call ok(getVT(2+null) = "VT_NULL", "getVT(2+null) = " & getVT(2+null))
Call ok(2+empty = 2, "2+empty = " & (2+empty))
Call ok(5-1 = 4, "5-1 = " & (5-1))
Call ok(3+5-true = 9, "3+5-true <> 9")
Call ok(getVT(2-null) = "VT_NULL", "getVT(2-null) = " & getVT(2-null))
Call ok(2-empty = 2, "2-empty = " & (2-empty))
reportSuccess()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment