jmlynesjr has asked for the wisdom of the Perl Monks concerning the following question:
I have the following event handler dealing with a change in a Wx::TextCtrl:
Wx::Event::EVT_TEXT($self, $IcqText, sub { my ($self, $event) = @_; $self->{AMP1}->Icq(($IcqText->GetValue) / 1000 +);});
Where $IcqText->GetValue returns a wxString and the / 1000 throws the warning Argument "" isn't numeric in division (/) at ./CEAmp.pl line 163. The division is successfully completed.
The following modification masks the warning:
Wx::Event::EVT_TEXT($self, $IcqText, sub { my ($self, $event) = @_; { no warnings; $self->{AMP1}->Icq(($IcqText->GetValue) / 1000 +); } });
Is there an alternate way to "cast" the wxString to numeric?
James
There's never enough time to do it right, but always enough time to do it over...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Cast" a wxString to Numeric?
by Corion (Patriarch) on May 02, 2015 at 13:16 UTC | |
by jmlynesjr (Deacon) on May 02, 2015 at 18:27 UTC | |
|
Re: "Cast" a wxString to Numeric?
by Anonymous Monk on May 03, 2015 at 01:08 UTC | |
by jmlynesjr (Deacon) on May 03, 2015 at 19:46 UTC | |
by jmlynesjr (Deacon) on May 07, 2015 at 19:43 UTC |