Re: TextboxColumn Nur Zahlen (numerisch)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hallo Max,

>> Wir reden ja von .NET 2.0.
>> Hier haben wir momentan noch keine lokalisierten Strings.
> Was willst du mir damit sagen?

..NET 2.0 gibts momentan nur in Beta2-Englisch, dort gibt es
keine lokalisierten (z.B. deutschen) Strings, nur englische Texte.

>> "Value was either too large or too small for a Single."
> Das entspricht ja gerade der zweiten von mir geposteten Fehlermeldung.

Du hattest ein Byte geschrieben, aber in der Wirkung ist das so, richtig.

> Naja, die zwei Fehlermeldungen mehr wird man ja gerade noch hinbekommen.

Tja, es sind dann zusätzlich die lokalisierten Strings. Weisst Du wie das auf
Japanisch heisst. Das würde Parse sonst alles automatisch machen.
Laut MSDN2 sind es auch mindestens 3 Exceptiontypen.
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemSingleClassParseTopic2.asp
Diese kann man nur bei Parse so identifizieren und respektive behandeln.
Bei 5 Sprachen sind es schon 15 Strings, die man herauskriegen muss.
Ne also ich finde Parse da dann etwas angenehmer.
Auch bin ich mir nicht sicher, ob z.B. bei der FormatException nicht im .NET 2.0
Release noch viel mehr Fehlermeldungs-Varianten existieren (s.a. ->NumberStyles)
Mit Parse hätte man jedenfalls das Potential dafür.

Aber wie gesagt, Anwendungsfall-bezogen habe ich nichts gegen TryParse().
Mit ein bisschen Code, einem kleinen Regex und ein paar String-Ressourcen kann
man auch schon damit Fehlermeldungen generieren. Der Vorteil der Non-Exception
ist auch noch da.


ciao Frank
--
Dipl.Inf. Frank Dzaebel [MCP C#]
http://Dzaebel.NET


.



Relevant Pages

  • Re: Text Files or binaries with objects?
    ... I have some large text files that I need to repeatedly analyse. ... parse the strings and load the data into my custom object ready to be ... file many times over many sessions, to parse the text files once, then save ...
    (alt.comp.lang.borland-delphi)
  • Re: TextboxColumn Nur Zahlen (numerisch)
    ... > keine lokalisierten Strings, ... >> Fehlermeldung. ... > Laut MSDN2 sind es auch mindestens 3 Exceptiontypen. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Text Files or binaries with objects?
    ... I have some large text files that I need to repeatedly analyse. ... parse the strings and load the data into my custom object ready to be ... file many times over many sessions, to parse the text files once, then save ...
    (alt.comp.lang.borland-delphi)
  • Re: REXX 5 Message
    ... selected are determined by a Boolean expression relating the strings. ... IF, UNDER THE OREXX INTERPRETER, THIS CMD RUNS OUT OF RESOURCES ... parse value datetimewith. ... of drives to be searched */ ...
    (comp.lang.rexx)
  • Re: Is it possible to have special characters in list
    ... You *have* to parse that line by line! ... While I agree that one can't treat arbitrary strings as a list, ... way to sensibly handle that list, just because the plaintext-column ... targetted to the problem at hand (parsing that particular format), ...
    (comp.lang.tcl)