vbscript: Added Now() implementation.
This commit is contained in:
parent
c5a4878f5f
commit
9554e44e47
|
@ -130,6 +130,15 @@ static inline HRESULT return_null(VARIANT *res)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static inline HRESULT return_date(VARIANT *res, double date)
|
||||
{
|
||||
if(res) {
|
||||
V_VT(res) = VT_DATE;
|
||||
V_DATE(res) = date;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT to_int(VARIANT *v, int *ret)
|
||||
{
|
||||
switch(V_VT(v)) {
|
||||
|
@ -967,8 +976,14 @@ static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIA
|
|||
|
||||
static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
|
||||
{
|
||||
FIXME("\n");
|
||||
return E_NOTIMPL;
|
||||
SYSTEMTIME lt;
|
||||
double date;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
GetLocalTime(<);
|
||||
SystemTimeToVariantTime(<, &date);
|
||||
return return_date(res, date);
|
||||
}
|
||||
|
||||
static HRESULT Global_Date(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
|
||||
|
|
|
@ -232,4 +232,6 @@ if isEnglishLang then
|
|||
Call ok(MonthName(12, true) = "Dec", "MonthName(12, true) = " & MonthName(12, true))
|
||||
end if
|
||||
|
||||
Call ok(getVT(Now()) = "VT_DATE", "getVT(Now()) = " & getVT(Now()))
|
||||
|
||||
Call reportSuccess()
|
||||
|
|
|
@ -173,6 +173,8 @@ static const char *vt2a(VARIANT *v)
|
|||
return "VT_I4";
|
||||
case VT_R8:
|
||||
return "VT_R8";
|
||||
case VT_DATE:
|
||||
return "VT_DATE";
|
||||
case VT_BSTR:
|
||||
return "VT_BSTR";
|
||||
case VT_DISPATCH:
|
||||
|
|
Loading…
Reference in New Issue