niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl
Clock
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
Author Message
TheOrangeRemix
*nix forums beginner


Joined: 28 Jun 2006
Posts: 2

PostPosted: Thu Jul 20, 2006 5:42 pm    Post subject: Clock Reply with 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?
Back to top
usenet@DavidFilmer.com
*nix forums Guru


Joined: 25 Jul 2005
Posts: 545

PostPosted: Thu Jul 20, 2006 6:10 pm    Post subject: Re: Clock Reply with quote

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

PostPosted: Thu Jul 20, 2006 11:26 pm    Post subject: Re: Clock Reply with quote

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

PostPosted: Fri Jul 21, 2006 1:15 am    Post subject: Re: Clock Reply with quote

"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 Smile might be able to help out.

Cheers,
Rob
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 1:27 pm | All times are GMT
navigation Forum index » Programming » Perl
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts clock() returns 0 gramos2000@gmail.com apps 1 Mon Jul 17, 2006 4:16 pm
No new posts Clock applet in Gnome can't be loaded Daniel Böhmer Gentoo 1 Sun Jul 16, 2006 7:01 pm
No new posts Read System Clock in Windows Moikel C 5 Fri Jul 14, 2006 10:23 pm
No new posts Use of local clock with ntp zcorce@aol.com Solaris 5 Fri Jul 14, 2006 6:17 pm
No new posts time.clock() Tobiah python 6 Fri Jul 14, 2006 9:13 am

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
[ Time: 0.1434s ][ Queries: 20 (0.0570s) ][ GZIP on - Debug on ]