Serge
Thu May 08 16:42:40 CDT 2008
Chris,
Beware of quantum physics. This stuff is way too unstable to be used in a
beginner's program: Catching the exception is somehow measuring it, which
would bring Heisenberg and his uncertainty principle into the game. From
there on, false would no longer be sure whether he's actually as false as
that, which would probably lead to more exceptions being thrown randomly.
You'd probably need to include some statistical physics library into your
program to analyze the spectrum of these exceptions. Monte Carlo would
surely help. And that's where it hurts: Do Monte Carlo implementations
internally use bool results? Better not because they'd start colliding into
these other bools they are evaluating, which might actually lead to a bool
fission reaction. Which by globally destroying the whole binary system would
somehow solve the OP's concern the hard way (lack of any form of computer, I
mean). And all we wanted to do is to know if a string can be converted to an
int. I warned you: Unstable stuff, this quantum physics.
BTW, do you think this could be considered experimental evidence of the
butterfly effect? Someone should give it a try some day.
Serge.
http://www.apptranslator.com
"Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> wrote in message
news:OExJIsSsIHA.5872@TK2MSFTNGP04.phx.gbl...
>I see. That's way more complex then.
>
> public bool IsInt(string value)
> {
> try { int.Parse(value); }
> catch { return false; }
> return true;
> }
>
> Close to quantum physics.
>
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Giving back to the embedded community
>
http://community.OpenNETCF.com
>
> "Malani Czornon" <pusy06@aol.com> wrote in message
> news:%23F6hMoSsIHA.4544@TK2MSFTNGP04.phx.gbl...
>> Thanks Chirs for your reply, but Parse doesn´t return true or false....
>> it returns an expection....
>> I need to get a bool value...
>>
>>
>>
>> "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> escribió en el mensaje
>> news:Otvdj0RsIHA.548@TK2MSFTNGP06.phx.gbl...
>>> Depending on your needs, most of the Parse functions would work:
>>>
>>> int myval = int.Parse(textBox.Text);
>>> float myval = float.Parse(textBox.Text);
>>>
>>> etc.
>>>
>>>
>>> --
>>>
>>> Chris Tacke, Embedded MVP
>>> OpenNETCF Consulting
>>> Giving back to the embedded community
>>>
http://community.OpenNETCF.com
>>>
>>> "Malani Czornon" <pusy06@aol.com> wrote in message
>>> news:u$iM8oRsIHA.4840@TK2MSFTNGP05.phx.gbl...
>>>> Hi, are there any function in C# to validate that the value from a
>>>> textbox to be numeric ?
>>>>
>>>> Thanks in advance.
>>>>
>>>
>>>
>>
>>
>
>