The script below outputs the correct $number (hash key) but for some reason
it also outputs the value. What gives?
-Pete
###
use strict;
my %countother;
print File: ;
chomp(my $file=STDIN);
open(FILE,$file) || die can't open file : $!\n;
foreach (FILE)
{
I have just upgraded to a computer that is using XP SP1, and I installed
Perl 5.6.1 Build 633, and used PPM to install the current release of
Win32::GUI from ActiveState. The version number is 0.0.558.
Now, I can no longer get any of the Win32::GUI scripts to work, and cannot
make a new GUI
That's how it's supposed to act. If you don't want the value, change the
last 4 lines to this:
foreach my $number (keys %countother)
{
print $number\n;
}
You need to specify keys if you don't want the value to also be printed.
Steve H.
-Original Message-
From: Peter
At 09:38 2002-11-22 -0500, Peter Eisengrein wrote:
The script below outputs the correct $number (hash key) but for some
reason it also outputs the value. What gives?
-snip-
foreach my $number (%countother)
foreach my $number (keys %countother)
/J
-- --- -- -- -- --
Pete,
You forgot the 'keys' in your foreach statement.
ie
foreach my $number (%countother)
should be
foreach my $number ( keys %countother)
otherwise the foreach loops through both keys and values.
Cheers,
Kev.
|-+
|
I used The Gui Loft to create a TabStip for various screens...
For some reason, a tab change using the arrow keys and/or tab key does NOT
execute the sub TabStrip_Change.
A mouse click on a tab DOES execute the sub TabStrip_Click.
Has anyone been able to get the tab change using the arrow
I was looking on an API reference site for information on saving the Custom
Colors in the ChooseColor dialog. It appears it is only returning a single
value. When I use ChooseColor I initalize it with the current
color. $getcolor is what is returned (what I choose from the dialog
box). I
Microsoft says you can use WS_OVERLAPPEDWINDOW combined with WS_VSCROLL
and WS_HSCROLL
To create a window that scrolls. I can not get this to work in
Win32::GUI.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Eric Hansen
Sent: Friday, November 22,
PeachTree Accounting is an application I find as an example that has
child window(s) within a main window. As the main window
Is moved, the child windows move along with it and remain in the same
relative position in the main window client area.
The scroll bars on the main window are hidden
Try playing about with the following (it won't work in version
.665 - and don't ask me how/why it works in .558!). I use it to draw
rectangles for widgets in a primitive but quite useful gui designer
that makes Perl do much of the work we all lo-o-o-ove to do manually.
vPerl it ain't, however! You
10 matches
Mail list logo