Shouldn’t this line of code triggers a compiler error?
Dim s As String = Str( "Another string" )
Shouldn’t this line of code triggers a compiler error?
Dim s As String = Str( "Another string" )
[quote=142871:@Eric de La Rochette]Shouldn’t this line of code triggers a compiler error?
Dim s As String = Str( "Another string" )
You’d think so, but Str actually takes a Variant. This change was made when Int8, Int16, Int32, Int64, and their unsigned counterparts were added to the language.
Why not simply have a versions for Int64, UInt64, Currency and Double and let the compiler pick the right one?
I guess variant was easier…
On the other side you can send in dates, too. And custom classes with Operator_Convert to string, I think.