.val but no .str?

Just curious as to why it’s possible to convert a string variable to a value by using “.val” but there was never an implementation of converting a value to a string using “.str”?

dim testString as string
dim testValue as integer

testValue = testString.val 'this works instead of using: testValue = val(testString)
testString = testValue.str 'this does not work, as this was never implemented; instead must use: testString = str(testValue)

Not sure why .Str isn’t built-in, but a workaround is this method in a Module…

Function Str(extends v As double) As String return Str(v) End Function
Seems to work ok but maybe there’s issues I don’t see.

Exactly. Use extends. You can also add the .net style ones like .contains .tostring etc.

The webinars on the xojo website has a video showing some of this in use although I don’t recall which one they are in.

IIRC, it was entitled Cool Language Features.