[Gambas-user] TRY bug example
Benoit Minisini
gambas at ...1...
Sat Dec 10 14:03:29 CET 2005
On Saturday 10 December 2005 12:54, nando wrote:
> Thank you Benoit.
> Although I find it a bit inconsistent,
> it makes sense for the way it has been implemented.
> You have answered many questions.
> And I sincerely do thank you.
> It clears some of the fog.
>
> Perhaps do you think that CStr(False) should return F instead of NULL?
> Since PRINT "HELLO: " & ERROR & " is the error" shows T for TRUE
> then would F be a logical for False if using CSTR in the &.
> You are converting to a string.
>
> -Fernando
>
Cxxx() functions are conversion functions, and CStr() does not return things
that are necessarily readable by the human.
CStr(FALSE) return NULL because CBool(aString) return FALSE only if the string
is NULL. If CStr(FALSE) returns 'F', then CBool(CStr(FALSE)) = TRUE, which is
not coherent!
Try to think about all possible conversions between all possible datatypes,
and you will see that actually Gambas conversion functions are coherent :-)
Regards,
--
Benoit Minisini
More information about the User
mailing list