Kyle.Allbright
Active member
- Joined
- Apr 19, 2010
- Messages
- 28
- Programming Experience
- 1-3
Hey guys, Ok the problem is with this code:
If the innertext is a correct date, then the equation suceeds, however when the innerText is blank, which sometimes it will be, it throws exception cannot convert "" to Date. Now this makes sense of course.
I am wondering if there is a "simple" way to avoid this error, without needing to add lines such as:
if innertext <> "" then
if innertext < date
I am wondering this as the full expression I am running is similiar to:
If x = True Or Innertext < Date And innerText > prevDate
therefore I would need alot of added blocks of code, in order to prevent exceptions.
Thanks guys.
Note: The "Calc.DateLongToDateShort" method converts the input date of innerText from 19 February 2009 to 19/02/2009
Calc.DateLongToDateShort(tempxmlnodelist(j).Item("_date").InnerText) < Date.Now Then
If the innertext is a correct date, then the equation suceeds, however when the innerText is blank, which sometimes it will be, it throws exception cannot convert "" to Date. Now this makes sense of course.
I am wondering if there is a "simple" way to avoid this error, without needing to add lines such as:
if innertext <> "" then
if innertext < date
I am wondering this as the full expression I am running is similiar to:
If x = True Or Innertext < Date And innerText > prevDate
therefore I would need alot of added blocks of code, in order to prevent exceptions.
Thanks guys.
Note: The "Calc.DateLongToDateShort" method converts the input date of innerText from 19 February 2009 to 19/02/2009