1. systemtime

Hi;

Could anyone please explain to me how to use and for what is this function 
from win32lib:


fecth_systemtime(atom SYSTEMTIME)


In the win32lib documentation there's is nothing about it.


Thanks

Rubens

new topic     » topic index » view message » categorize

2. Re: systemtime

On Thu, 18 Sep 2003 22:08:30 -0300 (09/19/03 11:08:30)
, <rml at rubis.trix.net> wrote:

>
> Could anyone please explain to me how to use and for what is this 
> function from win32lib:
>
>
> fecth_systemtime(atom SYSTEMTIME)
>
>
> In the win32lib documentation there's is nothing about it.
>

So about the poor docs, I'll fix that. Anyhow, all this does is return the 
data inside the supplied SYSTEMTIME structure pointer as a formatted 
sequence of values. Namely ...

     {
      Year,
      Month,
      DayOfWeek,
      Day,
      Hour,
      Minute,
      Second,
      Milliseconds
     }

Now the real question is, how does the SYSTEMTIME structure get the right 
values into it? Currently, these values are populated by the MonthCalendar 
control type. In the next release there is also two new functions - 
getSystemTime() which returns the current date/time in UTC and 
getLocalTime() which returns it according to your timezone settings.

If you can't wait for the next release, here are the two new functions...


Firstly though you will need to add these three lines just after the 
win32lib include...

constant
     xGetSystemTime      = registerw32Procedure(kernel32,"GetSystemTime", 
{C_POINTER}),
     xGetLocalTime       = registerw32Procedure(kernel32,"GetLocalTime", 
{C_POINTER})

------------------------
-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

3. Re: systemtime

On Thu, 18 Sep 2003 22:08:30 -0300 (09/19/03 11:08:30)
, <rml at rubis.trix.net> wrote:

>
> Could anyone please explain to me how to use and for what is this 
> function from win32lib:
>
>
> fecth_systemtime(atom SYSTEMTIME)
>
>
> In the win32lib documentation there's is nothing about it.
>

So about the poor docs, I'll fix that. Anyhow, all this does is return the 
data inside the supplied SYSTEMTIME structure pointer as a formatted 
sequence of values. Namely ...

      {
       Year,
       Month,
       DayOfWeek,
       Day,
       Hour,
       Minute,
       Second,
       Milliseconds
      }

Now the real question is, how does the SYSTEMTIME structure get the right 
values into it? Currently, these values are populated by the MonthCalendar 
control type. In the next release there is also two new functions - 
getSystemTime() which returns the current date/time in UTC and 
getLocalTime() which returns it according to your timezone settings.

If you can't wait for the next release, here are the two new functions...


Firstly though you will need to add these three lines just after the 
win32lib include...

constant
      xGetSystemTime      = registerw32Procedure(kernel32,"GetSystemTime", 
{C_POINTER}),
      xGetLocalTime       = registerw32Procedure(kernel32,"GetLocalTime", 
{C_POINTER})

------------------------
--/topic Utilities
--/func getSystemTime()
--/desc Gets the date and time as UTC (a.k.a. GMT)
--/ret SEQUENCE: The date and time (See below for details)
--This does not need any parameters. The date and time are returned
-- as UTC (Coordinated Universal Time) which is the old Greenwich Mean 
Time.
--
--The return sequence has eight elements arranged thus /n
--/li      Year
--/li      Month
--/li      DayOfWeek
--/li      Day
--/li      Hour
--/li      Minute
--/li      Second
--/li      Milliseconds
--
--Example:
--/code
--      sequence tm
--      tm = getSystemTime()
--/endcode

global function getSystemTime()
     atom lST
     sequence lResult

     lST = acquire_mem(0, SIZEOF_SYSTEMTIME)
     w32Proc(xGetSystemTime,{lST})

     lResult = fetch_SYSTEMTIME(lST)
     release_mem(lST)
     return lResult

end function

--/topic Utilities
--/func getLocalTime()
--/desc Gets the date and time according to your timezone settings.
--/ret SEQUENCE: The date and time (See below for details)
-- This does not need any parameters. The date and time are returned
-- based on your system's current timezone settings.
--
--The return sequence has eight elements arranged thus /n
--/li      Year
--/li      Month
--/li      DayOfWeek
--/li      Day
--/li      Hour
--/li      Minute
--/li      Second
--/li      Milliseconds
--
--Example:
--/code
--      sequence tm
--      tm = getLocalTime()
--/endcode

global function getLocalTime()
     atom lST
     sequence lResult

     lST = acquire_mem(0, SIZEOF_SYSTEMTIME)
     w32Proc(xGetLocalTime,{lST})

     lResult = fetch_SYSTEMTIME(lST)
     release_mem(lST)
     return lResult

end function

-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

4. Re: systemtime

Sorry Derek, I just receive the other "complete" email from topica now.

The program is working now.

Thanks

Rubens



At 02:01 19/9/2003, you wrote:
>
>On Thu, 18 Sep 2003 22:08:30 -0300 (09/19/03 11:08:30)
>, <rml at rubis.trix.net> wrote:
>
>>
>>Could anyone please explain to me how to use and for what is this 
>>function from win32lib:
>>
>>
>>fecth_systemtime(atom SYSTEMTIME)
>>
>>
>>In the win32lib documentation there's is nothing about it.
>
>So about the poor docs, I'll fix that. Anyhow, all this does is return the 
>data inside the supplied SYSTEMTIME structure pointer as a formatted 
>sequence of values. Namely ...
>
>     {
>      Year,
>      Month,
>      DayOfWeek,
>      Day,
>      Hour,
>      Minute,
>      Second,
>      Milliseconds
>     }
>
>Now the real question is, how does the SYSTEMTIME structure get the right 
>values into it? Currently, these values are populated by the MonthCalendar 
>control type. In the next release there is also two new functions - 
>getSystemTime() which returns the current date/time in UTC and 
>getLocalTime() which returns it according to your timezone settings.
>
>If you can't wait for the next release, here are the two new functions...
>
>
>Firstly though you will need to add these three lines just after the 
>win32lib include...
>
>constant
>     xGetSystemTime      = registerw32Procedure(kernel32,"GetSystemTime", 
> {C_POINTER}),
>     xGetLocalTime       = registerw32Procedure(kernel32,"GetLocalTime", 
> {C_POINTER})
>
>------------------------
>--
>
>cheers,
>Derek Parnell
>
>
>
>TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: systemtime

Hi Derek;

Thanks for the quick response!


I write this small program:

----------------------------------------------------------------------------
include Win32lib.ew
constant xGetSystemTime = registerw32Procedure(kernel32,"GetSystemTime", 
{C_POINTER})
constant xGetLocalTime  = registerw32Procedure(kernel32,"GetLocalTime", 
{C_POINTER})

object bla,t

t=GetSystemTime()
bla=message_box(sprint(t),"",0)

E:\EUPHORIA\PROGRAMAS\backup.EXW:10
GetSystemTime has not been declared
t=GetSystemTime()
               ^


Rubens



At 02:01 19/9/2003, you wrote:
>
>On Thu, 18 Sep 2003 22:08:30 -0300 (09/19/03 11:08:30)
>, <rml at rubis.trix.net> wrote:
>
>>
>>Could anyone please explain to me how to use and for what is this 
>>function from win32lib:
>>
>>
>>fecth_systemtime(atom SYSTEMTIME)
>>
>>
>>In the win32lib documentation there's is nothing about it.
>
>So about the poor docs, I'll fix that. Anyhow, all this does is return the 
>data inside the supplied SYSTEMTIME structure pointer as a formatted 
>sequence of values. Namely ...
>
>     {
>      Year,
>      Month,
>      DayOfWeek,
>      Day,
>      Hour,
>      Minute,
>      Second,
>      Milliseconds
>     }
>
>Now the real question is, how does the SYSTEMTIME structure get the right 
>values into it? Currently, these values are populated by the MonthCalendar 
>control type. In the next release there is also two new functions - 
>getSystemTime() which returns the current date/time in UTC and 
>getLocalTime() which returns it according to your timezone settings.
>
>If you can't wait for the next release, here are the two new functions...
>
>
>Firstly though you will need to add these three lines just after the 
>win32lib include...
>
>constant
>     xGetSystemTime      = registerw32Procedure(kernel32,"GetSystemTime", 
> {C_POINTER}),
>     xGetLocalTime       = registerw32Procedure(kernel32,"GetLocalTime", 
> {C_POINTER})
>
>------------------------
>--
>
>cheers,
>Derek Parnell
>
>
>
>TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu