<div dir="ltr">2018-06-29 14:30 GMT-04:00 Tobias Boege <span dir="ltr"><<a href="mailto:taboege@gmail.com" target="_blank">taboege@gmail.com</a>></span>:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> ok how can i force the type of result from variant to boolean<br>
</span>This is not the problem. Despite being inside a Variant "container",<br>
False is still known to be a Boolean internally and will be printed<br>
correctly. Just try it:<br>
<br>
  Dim a As Variant = False<br>
  Print a<br>
  > False<br></blockquote><div>works! so then following your mail we get some details that let me in same situation:<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="">
</span>Here, you are concatenating a Boolean to a string. This coerces the Boolean<br>
to a string, but it does so using CStr(), which prints False as Null, which<br>
is the empty string, as I explained earlier. It's not that you "Print", but<br></blockquote><div>i understant clear that you posted! please see that:<br><br></div><div>but in any case inclusivelly usign your suggested funtion code does not return "False" so  <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
that you "&". Either use Str$(exu.email(...)) or<br>
  Print exu.email("mpes");; "y este";; exu.email("<a href="mailto:email@mail.com">email@mail.com</a>")<br>
and Print will take care of the human-friendly Boolean conversion.<br></blockquote><div>this let me in same situation, normal print does not print the variable jajajajajaj XD XD<br><br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

BTW, I personally wouldn't write the function like that in the first place.<br>
You only get in trouble because the returned datatype depends on the argument.<br></blockquote><div>yeah now i got "T" for match case but still "null" or empty for false!<br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I would write it like this:<br>
<br>
  Public Function email(texto As Variant) As Boolean<br>
    ' For performance: compile the pattern once and cache it<br>
    Return texto Match "^[A-Za-z0-9._%+-]+@[A-Za-z0-<wbr>9.-]+\\.[A-Za-z]{2,8}$"<br>
  Endif<br>
<br>
and use it to actually branch in the code that wants to do something<br>
with texto. But if you really value the one-liner here, there's probably<br>
no other choice.<br></blockquote><div>that's horrible, i think its a bug now! as you can see in the previously code!<br></div><div>i need a solution to mantain simple a keep compatibility, gambas becomes be too unflexible! currently the odbc in 3.11 are a crap and now details like this!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
PS: As always when someone posts a regex for email addresses, yours is<br>
not quite perfect. For starters, we have very long TLDs these days,<br>
like .christmas, .engineering or .cancerresearch [1], which your regex<br>
will reject.<br>
<br>
[1] <a href="https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/<wbr>List_of_Internet_top-level_<wbr>domains</a></blockquote><div>YES you have right but i not have enought experience in regex xpressions i send another mail to mantain this in context!<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<div class="HOEnZb"><div class="h5"><br>
-- <br>
"There's an old saying: Don't change anything... ever!" -- Mr. Monk<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></div>