Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Clock

Reply
Thread Tools

Clock

 
 
TheOrangeRemix
Guest
Posts: n/a
 
      07-20-2006
Hi,

I would like to set up a script that includes a Windows API interface
of a pop-up that displays a changeable date and time. Whatever date and
time is set, the program will input that data into a time array.

For example, I if I run the program, set today's date and time on the
interface: July 20, 2006 10:40 AM, it will output the result into an
array like this:

@runtime = (0, 40, 10, 20, 6, 2006); ### (seconds, minutes, hours, day,
month (-1), year)

I guess there are two questions involved: how do I call the described
API and how does it get placed into an array for processing?

 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      07-20-2006
TheOrangeRemix wrote:
> For example, I if I run the program, set today's date and time on the
> interface: July 20, 2006 10:40 AM, it will output the result into an
> array like this:
>
> @runtime = (0, 40, 10, 20, 6, 2006); ### (seconds, minutes, hours, day,
>
> I guess there are two questions involved: how do I call the described
> API and how does it get placed into an array for processing?


You can use a module like Date::Manip to convert the man-readable date
to something your system can understand. Date::Manip can also provide
the info for the array, or you could use Perl's own gmtime/localtime
function (which outputs in array form if called in array context - you
just use a [0-5] slice to get what you want in @runtime).

--
David Filmer (http://DavidFilmer.com)

 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      07-20-2006

Quoth "TheOrangeRemix" <(E-Mail Removed)>:
> Hi,
>
> I would like to set up a script that includes a Windows API interface
> of a pop-up that displays a changeable date and time. Whatever date and
> time is set, the program will input that data into a time array.
>
> For example, I if I run the program, set today's date and time on the
> interface: July 20, 2006 10:40 AM, it will output the result into an
> array like this:
>
> @runtime = (0, 40, 10, 20, 6, 2006); ### (seconds, minutes, hours, day,
> month (-1), year)
>
> I guess there are two questions involved: how do I call the described
> API and how does it get placed into an array for processing?


Win32::GUI is the literal answer to your question. It hides very little
of the Win32 API though, so it may be rather hard to use.

I quite liked Win32::GUI::XMLBuilder when I was playing with it, but I
didn't try to do anything serious.

Tk used to be the standard GUI toolkit for Perl, but it seems to be
looked-down-upon nowadays.

Wx is what most people would recommend now, though as I understand it
the Perl documentation is somewhat poor, and you have to use the C++
docs.

TMTOWTDI

Ben

--
I touch the fire and it freezes me, [(E-Mail Removed)]
I look into it and it's black.
Why can't I feel? My skin should crack and peel---
I want the fire back... Buffy, 'Once More With Feeling'
 
Reply With Quote
 
Sisyphus
Guest
Posts: n/a
 
      07-21-2006

"TheOrangeRemix" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hi,
>
> I would like to set up a script that includes a Windows API interface
> of a pop-up that displays a changeable date and time. Whatever date and
> time is set, the program will input that data into a time array.
>
> For example, I if I run the program, set today's date and time on the
> interface: July 20, 2006 10:40 AM, it will output the result into an
> array like this:
>
> @runtime = (0, 40, 10, 20, 6, 2006); ### (seconds, minutes, hours, day,
> month (-1), year)
>
> I guess there are two questions involved: how do I call the described
> API and how does it get placed into an array for processing?
>


David has given you advice on how to manipulate the date.

I don't quite follow the Windows API requirements, but if you are wanting to
create a message box pop-up on Windows you can do so with the
Win32::MsgBox() function:

use warnings;
use Win32;

my $message = "wow!!";
Win32::MsgBox($message);
__END__

But if you need your perl script to read in the info from a pop-up .... then
that's not so straightforward. If that's the case, let us know, and someone
(probably not me might be able to help out.

Cheers,
Rob


 
Reply With Quote
 
TheOrangeRemix
Guest
Posts: n/a
 
      07-21-2006
Thank you all for the suggestions. What I am looking for is a Windows
API that displays a editable clock and whatever the user inputs will be
read into the script and processed in an array.
Is there a function or a set of functions that I can use to accomplish
these two tasks?

 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      07-21-2006

Quoth "TheOrangeRemix" <(E-Mail Removed)>:
> Thank you all for the suggestions. What I am looking for is a Windows
> API that displays a editable clock and whatever the user inputs will be
> read into the script and processed in an array.


AFAIK windows doesn't provide such a control. You could build one
yourself, using one of the toolkits I mentioned; or you could see if you
can find an ActiveX control that does what you want (though this may be
a lot of pain ).

Ben

--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single clock pulse transfer to different clock domains. himassk VHDL 1 05-16-2007 10:41 AM
Arbitrary Clock Frequencies From Base Clock abhisheknag@gmail.com VHDL 5 06-23-2006 12:45 PM
What is the best way to clock data in on one clock edge and out on another? simon.stockton@baesystems.com VHDL 4 04-26-2006 11:36 PM
Sync for PC clock and server clock PS Computer Support 3 05-13-2005 05:27 AM
Are clock and divided clock synchronous? Valentin Tihomirov VHDL 11 10-28-2003 01:18 PM



Advertisments