[Gambas-user] print does not output if the var is FALSE, how to override?

PICCORO McKAY Lenz mckaygerhard at gmail.com
Thu Jun 28 23:35:10 CEST 2018


2018-06-28 9:13 GMT-04:00 Tobias Boege <taboege at gmail.com>:

> Are you sure? I get
>
>   $ cat false.gbs3
>   #!/usr/bin/env gbs3
>
>   Public Sub Main()
>     Dim var As Boolean
>     Print var
>   End
>   $ ./false.gbs3
>   False
>
i get only no out! i'm using gambas 3.10 maybe a bug!?


> Print calls Str$() to convert values to strings and Str$(False) is the
> string "False", it's not empty. You or your Print seems to call CStr()
> for whatever reason which converts the Boolean False to the Null string,
> as that is the only falsy string in Gambas.
>
i still not override or changed the print ! i'm just use directly



> Instead of Jussi's suggestion with IIf() you can also use Str$(),
> if you really just want "True" or "False" to be printed and not some
> other strings.
>
well seems to work, but i want something more direct,

so them how to override the print rule/code/class ?


>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180628/dae64340/attachment.html>


More information about the User mailing list