Re: Datatype checking in DotNET



Oh what a mess from that last message (/me has to watch my copy and pasting LOL!):-

Hi Nicholas,

Yeah I am doing that now at the moment for example as based on the given
example previously:-

I use StrToFloat, if this fails, it raises an exception (Which is fine of
course).

But what I am trying to achieve here is to ensure the data integrity, does
the data meet the float bounds?????

For integers you could do a test like this:-

tempVal := StrToInt (fieldStr);
if (tempVal < low (IntImSavingToo )) or (tempVal > high
(IntImSavingToo )) then
exit;
IntImSavingToo := tempVal;

Is there something I can use for floats, doubles and singles also???

Daniel.

.



Relevant Pages

  • Re: Datatype checking in DotNET
    ... Yeah I am doing that now at the moment for example as based on the given ... But what I am trying to achieve here is to ensure the data integrity, ... StrToFloat will almost certainly do that too. ... Give it a try with a really big float, ...
    (comp.lang.pascal.delphi.misc)
  • Re: Datatype checking in DotNET
    ... You can use a function called StrToFloat ... But what I am trying to achieve here is to ensure the data integrity, does the data meet the float bounds????? ... (IntImSavingToo)) ...
    (comp.lang.pascal.delphi.misc)