![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Thu, Mar 7 2013 11:39 AM | Permanent Link |
Matthew Jones | What is the best way of implementing StrToIntDef in EWB?
(Can you tell I'm importing utility routines from Delphi?) You have StrToInt but the help doesn't describe what happens if I pass it 'dog' as a parameter. /Matthew Jones/ |
Fri, Mar 8 2013 11:27 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Matthew,
<< You have StrToInt but the help doesn't describe what happens if I pass it 'dog' as a parameter. >> You'll get back NaN (not a number): ShowMessage(IntToStr(StrToInt('Dog'))); Tim Young Elevate Software www.elevatesoft.com |
Mon, Mar 11 2013 6:19 AM | Permanent Link |
Matthew Jones | Okay, I can work with that.
/Matthew Jones/ |
Mon, Mar 11 2013 11:06 AM | Permanent Link |
Matthew Jones | > You'll get back NaN (not a number):
For completeness (I was going to ask how to test for Nan), the WebDom unit includes isNaN(), so the end result is: function StrToIntDef(szValue : String; nDefault : Integer) : Integer; begin Result := StrToInt(szValue); if isNaN(Result) then Result := nDefault; end; /Matthew Jones/ |
Mon, Mar 11 2013 1:59 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Matthew,
<< For completeness (I was going to ask how to test for Nan), the WebDom unit includes isNaN(), so the end result is: >> I'll try to pop this in the WebCore unit in the next build. Thanks, Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, August 14, 2024 at 03:12 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |