|
|
|
|
|
|
| Author |
Message |
TheOrangeRemix *nix forums beginner
Joined: 28 Jun 2006
Posts: 2
|
Posted: Thu Jul 20, 2006 5:42 pm Post subject:
Clock
|
|
|
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? |
|
| Back to top |
|
 |
usenet@DavidFilmer.com *nix forums Guru
Joined: 25 Jul 2005
Posts: 545
|
Posted: Thu Jul 20, 2006 6:10 pm Post subject:
Re: Clock
|
|
|
TheOrangeRemix wrote:
| Quote: | 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) |
|
| Back to top |
|
 |
Ben Morrow *nix forums Guru Wannabe
Joined: 24 Apr 2006
Posts: 193
|
Posted: Thu Jul 20, 2006 11:26 pm Post subject:
Re: Clock
|
|
|
Quoth "TheOrangeRemix" <fgchan@gmail.com>:
| Quote: | 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, [benmorrow@tiscali.co.uk]
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' |
|
| Back to top |
|
 |
Sisyphus *nix forums Guru
Joined: 04 Mar 2005
Posts: 503
|
Posted: Fri Jul 21, 2006 1:15 am Post subject:
Re: Clock
|
|
|
"TheOrangeRemix" <fgchan@gmail.com> wrote in message
news:1153417362.041583.81100@b28g2000cwb.googlegroups.com...
| Quote: | 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 |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sun Nov 23, 2008 1:27 pm | All times are GMT
|
|
Myspace Codes | Mortgages | Car Finance | Loans | Hosting
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|