[Openroad-users] WindowsAPI call to GetLocalTime

Darren Harvey darren.harvey at myworkplace.com.au
Wed Apr 30 14:05:21 EST 2008


Doug

 

Thanks for solving the last piece in the puzzle. This solution works
perfectly, and we can get the PC local time regardless of Ingres Timezone
settings using either fat-client or eClient solutions.

 

Darren

 

 

Regards

 

Darren Harvey

 



 

MyWorkplace Solutions Pty Limited

Level 5, 11 Queens Road

Melbourne Victoria 3004

 

Ph.       1300 733 731

Mob.     0400 398 188

Fax.      03 9710 1112

 

Making Service our Priority

 

www.MyWorkplace.com.au

 

If you receive this email by mistake, please notify us and do not make any
use of the email. We do not waive any privilege, confidentiality or
copyright associated with it.

 

  _____  

From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Doug White
Sent: Thursday, 24 April 2008 4:17 PM
To: International OpenROAD Users
Subject: Re: [Openroad-users] WindowsAPI call to GetLocalTime

 

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.
<http://a.ninemsn.com.au/b.aspx?URL=http://lavalife9.ninemsn.com.au/clickthr
u/clickthru.act?id%3Dninemsn%26context%3Dan99%26locale%3Den_AU%26a%3D30290&_
t=764581033&_r=email_taglines_Search_OCT07&_m=EXT>  

 

  _____  

Grab it. You dream job is up for grabs.
<http://mycareer.com.au/?s_cid=596065%20> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080430/620b7ff9/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 1436 bytes
Desc: not available
Url : http://www.peerlessit.com/pipermail/openroad-users/attachments/20080430/620b7ff9/attachment.jpe 


More information about the Openroad-users mailing list