<div dir="ltr"><div><span class="im">Dim hDate As Date</span></div><div><span class="im"><br></span></div><div><span class="im">Try hDate =</span><span class="im">Date(2018, 13, 1) </span><span class="im"> </span></div><br><div><span class="im"></span></div><span class="im">
</span> If Error Then<br>
Print "Date Error"<br>
Endif<br><div><br></div><div> If hDate = something Then</div><div><br></div><div>...</div><div><br></div><div><br></div><div>Jussi<br></div><div><br></div>
</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 19, 2018 at 11:46 PM, Mayost Sharon <span dir="ltr"><<a href="mailto:sharon@455.co.il" target="_blank">sharon@455.co.il</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is not a good option<br>
Because it will send a print every time<br>
If the date is correct<br>
<div class="HOEnZb"><div class="h5"><br>
---------- Original Message -----------<br>
From: Yahoo via User <<a href="mailto:user@lists.gambas-basic.org">user@lists.gambas-basic.org</a>><br>
To: Gambas Mailing List <<a href="mailto:user@lists.gambas-basic.org">user@lists.gambas-basic.org</a>>, Jussi Lahtinen<br>
<<a href="mailto:jussi.lahtinen@gmail.com">jussi.lahtinen@gmail.com</a>><br>
Cc: Yahoo <<a href="mailto:olivier.cruilles@yahoo.fr">olivier.cruilles@yahoo.fr</a>><br>
Sent: Tue, 19 Jun 2018 16:35:33 -0400<br>
Subject: Re: [Gambas-user] try if error<br>
<br>
> Better this form:<br>
> <br>
> Try Print Date(2018, 13, 1)<br>
> IF Error Then<br>
> Print "Wrong Date format"<br>
> else<br>
> ‘ Do something whit your date….<br>
> End If<br>
> <br>
> Cordialement,<br>
> — <br>
> Olivier Cruilles<br>
> Email: <a href="mailto:olivier.cruilles@yahoo.fr">olivier.cruilles@yahoo.fr</a><br>
> <br>
> Le June 19, 2018 à 16:30:03, Jussi Lahtinen (<a href="mailto:jussi.lahtinen@gmail.com">jussi.lahtinen@gmail.com</a>) a écrit:<br>
> <br>
> Oh, maybe you want to use Catch structure...<br>
> <a href="http://gambaswiki.org/wiki/lang/catch" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/<wbr>lang/catch</a><br>
> <br>
> Jussi<br>
> <br>
> On Tue, Jun 19, 2018 at 11:27 PM, Jussi Lahtinen <<a href="mailto:jussi.lahtinen@gmail.com">jussi.lahtinen@gmail.com</a>> wrote:<br>
> I don't understand the problem.<br>
> <br>
> If Error Then Goto ErrorHandling<br>
> <br>
> ...<br>
> <br>
> ErrorHandling:<br>
> Print "Here is my error handling"<br>
> <br>
> Jussi<br>
> <br>
> On Tue, Jun 19, 2018 at 11:22 PM, Mayost Sharon <<a href="mailto:sharon@455.co.il">sharon@455.co.il</a>> wrote:<br>
> In Visual Basic<br>
> there is<br>
> on error goto 0<br>
> <br>
> ---------- Original Message -----------<br>
> From: PICCORO McKAY Lenz <<a href="mailto:mckaygerhard@gmail.com">mckaygerhard@gmail.com</a>><br>
> To: Gambas Mailing List <<a href="mailto:user@lists.gambas-basic.org">user@lists.gambas-basic.org</a>><br>
> Sent: Tue, 19 Jun 2018 16:18:06 -0400<br>
> Subject: Re: [Gambas-user] try if error<br>
> <br>
> > 2018-06-19 16:06 GMT-04:00 Mayost Sharon <<a href="mailto:sharon@455.co.il">sharon@455.co.il</a>>:<br>
> ><br>
> > > Hello<br>
> > ><br>
> > > How do I proceed to the next line<br>
> > > If there is an error<br>
> > ><br>
> > for cases when it's error format or error of invalid date just:<br>
> ><br>
> > If Date(2018, 13, 1) Then<br>
> ><br>
> > for others error might be a good question unless compared using Comp() as<br>
> > strings!<br>
> ><br>
> > i dont know what other type of errors can be produced here!<br>
> ><br>
> > ><br>
> > > For example, if the date is not correct<br>
> > ><br>
> > > ' Gambas module file<br>
> > ><br>
> > > Public Sub Main()<br>
> > ><br>
> > > Try Print Date(2018, 13, 1)<br>
> > ><br>
> > > If Date(2018, 13, 1) Then<br>
> > ><br>
> > > Endif<br>
> > ><br>
> > > End<br>
> > ><br>
> > > Thank you<br>
> > ><br>
> > > ----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
> > ><br>
> ------- End of Original Message -------<br>
> <br>
> ----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
> <br>
> ----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
------- End of Original Message -------<br>
<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</div></div></blockquote></div><br></div>