[Gambas-user] Possible CDATE issue Latest version
brian at westwoodsvcs.com
Sun Nov 20 05:39:48 CET 2022
Still all I feel all default conversion should use the same conversion, regardless of the use. And then if anything different is needed it is up to programmer.
The way it is is kind of unexpected for such a consistent language.
Brian G Saturday, 19 November 2022, 04:19PM -08:00 from Benoit Minisini benoit.minisini at gambas-basic.org :
>Le 19/11/2022 à 21:14, Brian G a écrit :
> I am sorry but that is crazy.
> both should use the same conversion as, this is incredibly confusing
> for the user.
>No, because Print is intended to be used for printing things to the
>user, and so it uses localized conversion.
> if i want something other that what print would diplay I can specify the
> correct conversion - cstr(now)
> print now
> dim a as string = now
> print a
> should by common logic be equivelent, or have more confused users that
> anything else
>No, because there are two kinds of strings: those which are displayed to
>the user, and must be localized (and usually translated), and those
>which are internal and must not be localized.
>If you don't specify that explicitly with CStr() and Str(), you rely on
>As 'Print' is for printing to the user (normally), it assumes localized
>strings. Other automatic conversion assumes non localized strings.
>In a few words, if you don't get it, don't use implicit conversion.
>Always use explicit conversion.
> It would simplify so much if what is expected is shown.
> The default conversion should be he same for all uses of the date
> functions and values , and anything else shoul;d be specified.
> And what about the date(now) it is not working correctly at all it
> always a returns a time portion when it should only return the date
> according to the documentation. and the time is always 00:00:00 or
> 08:00:00 which is the diffrence to GMT for my location.
> This seems so messed up.
>No, Date() moves a date/time to the past at midnight in the current
>localization. That's all.
>Read https://gambaswiki.org/edit/doc/date again and again.
>----[ http://gambaswiki.org/wiki/doc/netiquette ]----
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the User