Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
StrToIntDef |
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. timyoung@elevatesoft.com | 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. timyoung@elevatesoft.com | 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 Thursday, December 12, 2024 at 02:38 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |