[Openroad-users] WindowsAPI call to GetLocalTime

gareth.2.edwards at bt.com gareth.2.edwards at bt.com
Thu Apr 24 20:28:12 EST 2008


Could you explain how you came up with that solution, as i was banging my head for an hour or so on this.
 

Cheers, 
Gareth Edwards 

BT Global Services 
t: +44 (0)131 300 1907 
e: Gareth.2.Edwards at BT.com <mailto:gareth.2.edwards at bt.com>  

 


________________________________

	From: openroad-users-bounces at peerlessit.com [mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Doug White
	Sent: Thursday, April 24, 2008 7:17 AM
	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/clickthru/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>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080424/5f4450ee/attachment.html 


More information about the Openroad-users mailing list