[Openroad-users] WindowsAPI call to GetLocalTime
Doug White
black_belt101 at hotmail.com
Thu Apr 24 16:17:05 EST 2008
Sorry all, heres the corrected (and tested) code
initialize()=
declare
wYear = INTEGER NOT NULL;
wMonth = INTEGER NOT NULL;
wDayOfWeek = INTEGER NOT NULL;
wDay = INTEGER NOT NULL;
wHour = INTEGER NOT NULL;
wMinute = INTEGER NOT NULL;
wSecond = INTEGER NOT NULL;
wMilliseconds = INTEGER NOT NULL;
Li_1 = INTEGER NOT NULL;
Li_2 = INTEGER NOT NULL;
Li_3 = INTEGER NOT NULL;
Li_4 = INTEGER NOT NULL;
enddeclare
{
CALLPROC GetLocalTime(
byref(Li_1),
byref(Li_2),
byref(Li_3),
byref(Li_4));
wSecond = MOD(Li_4,65536);
wMilliseconds = (Li_4 - wsecond) / 65536;
wHour = MOD(Li_3,65536);
wMinute = (Li_3 - wHour) / 65536;
wDayOfWeek = MOD(Li_2,65536);
wDay = (Li_2 - wDayOfWeek) / 65536;
wYear = MOD(Li_1,65536);
wMonth = (Li_1 - wYear) / 65536;
CurFrame.TRACE(
'Year: ' + VARCHAR(wYear) +
' Mth: ' + VARCHAR(wMonth) +
' DOW: ' + VARCHAR(wDayOfWeek) +
' Day: ' + VARCHAR(wDay) +
' Hr: ' + VARCHAR(wHour) +
' Min: ' + VARCHAR(wMinute) +
' Sec: ' + VARCHAR(wSecond) +
' MS : ' + VARCHAR(wMilliseconds));
}
__ÐöUgWa__
From: black_belt101 at hotmail.com
To: openroad-users at peerlessit.com
Date: Thu, 24 Apr 2008 15:21:35 +1000
Subject: Re: [Openroad-users] WindowsAPI call to GetLocalTime
Hey all, haven't read through every single post, but this is how you get data out of a STRUCT api call.
DECLARE
wYear = Integer NOT NULL;
wMonth = Integer NOT NULL;
wDayOfWeek = Integer NOT NULL;
wDay = Integer NOT NULL;
wHour = Integer NOT NULL;
wMinute = Integer NOT NULL;
wSecond = Integer NOT NULL;
wMilliseconds = Integer NOT NULL;
ENDDECLARE
{
Li_Return = CALLPROC GetLocalTime
( BYREF(wYear),
BYREF(wMonth),
BYREF(wDayOfWeek),
BYREF(wDay),
BYREF(wHour),
BYREF(wMinute),
BYREF(wSecond),
BYREF(wMilliseconds));
}
__ÐöUgWa__
Date: Wed, 23 Apr 2008 11:13:45 +0100
From: gareth.2.edwards at bt.com
To: openroad-users at peerlessit.com
Subject: Re: [Openroad-users] WindowsAPI call to GetLocalTime
>Where an API
specifies a STRUCT as a parameter, you should be able to declare a
LongByteObject to pass to the API.
I tried this with the following code and get a runtime
error.
DECLARE
LBO =
LongByteObject;
BEGIN
CALLPROC GetLocalTime
(BYREF(LBO));
=====
E_EO001B Objects and arrays can not be passed BYREF to
3GL procedures.
Parameter number 1 to the 3GL procedure
'GetLocalTime' is an object or
array value. Objects and
arrays can not be passed BYREF to 3GL
procedures.
You will have to remove the BYREF keyword from the
parameter list to this procedure.
=====
Click here Search for local singles online @ Lavalife.
_________________________________________________________________
You dream job is up for grabs. Grab it.
http://mycareer.com.au/?s_cid=596065
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080424/81b6c8d0/attachment.html
More information about the Openroad-users
mailing list