Commit 7a486010 authored by Shuai Meng's avatar Shuai Meng Committed by Alexandre Julliard

vbscript: Implemented Timer.

parent a1ff4f90
......@@ -130,6 +130,16 @@ static inline HRESULT return_double(VARIANT *res, double val)
return S_OK;
}
static inline HRESULT return_float(VARIANT *res, float val)
{
if(res) {
V_VT(res) = VT_R4;
V_R4(res) = val;
}
return S_OK;
}
static inline HRESULT return_null(VARIANT *res)
{
if(res)
......@@ -760,8 +770,13 @@ static HRESULT Global_Rnd(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
static HRESULT Global_Timer(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
SYSTEMTIME lt;
double sec;
GetLocalTime(&lt);
sec = lt.wHour * 3600 + lt.wMinute * 60 + lt.wSecond + lt.wMilliseconds / 1000.0;
return return_float(res, sec);
}
static HRESULT Global_LBound(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
......
......@@ -1264,4 +1264,6 @@ Call ok(getVT(RGB(&h1&, &h100&, &h111&)) = "VT_I4", "getVT(RGB(&h1&, &h100&, &h1
Call testRGBError(-1, &h1e&, &h3b&, 5)
Call testRGBError(&h4d&, -2, &h2f&, 5)
Call ok(getVT(Timer) = "VT_R4", "getVT(Timer) = " & getVT(Timer))
Call 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