Clock

T

TheOrangeRemix

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?
 
U

usenet

TheOrangeRemix said:
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).
 
B

Ben Morrow

Quoth "TheOrangeRemix said:
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
 
S

Sisyphus

TheOrangeRemix said:
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
 
T

TheOrangeRemix

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?
 
B

Ben Morrow

Quoth "TheOrangeRemix said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top