Kevin Old wrote:
>
> Hello all,
Hello,
> What I'd like to do is create a popup menu on a web page that
> has the hours 00-59 in it. Thing is, the only way I can come
> up to do it is by writing out something like below..and then
> putting a reference to this array in the code for the popup
I don't know about cgi but I think you can use prinf to add the leading
zero.
printf ("Minute %02d.\n", $value);
This should pad the output with a zeroes. The two there means that this is a
two digit number. If you've played with C you will recognise this.
I am also a new and could be dead wrong
doh.. for got the d
... sprintf ( "%02d", $_ ) ..
it's going to be a tiresome day.
> -Original Message-
> From: Kevin Old [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 10, 2002 11:50 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Hours popup menu
>
>
Nikola,
Thanks for getting me on the right track. Your code produces an array of "%02". I
tinkered with it and got it to work for me.
@hoursvals = map { /(\d+)/, $_ } (00 .. 59);
Thanks for your help
Kevin
On Mon, 10 Jun 2002 11:01:22 -0400
Nikola Janceski <[EMAIL PROTECTED]> wrote:
> @ho
First of all, are you trying to write hour or minute ?
I don't know if that's a must to use an array to carry those vals,
but how about :
$min = '0'.$min if ($min < 10 ) ;
- Original Message -
From: "Kevin Old" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 10, 2002 10:
@hoursvals = map { sprintf("%02", $_) } (00 .. 59);
> -Original Message-
> From: Kevin Old [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 10, 2002 10:47 AM
> To: [EMAIL PROTECTED]
> Subject: Hours popup menu
>
>
> Hello all,
>
> What I'd like to do is create a popup menu on a web page