Forum Discussion
EnTerr
11 years agoRoku Guru
Personally i recommend doing the type check with `getInterface(val, "ifString") <> invalid` instead. It's shorter and faster (just ran some tests - at least 2x faster in general, can be 7x faster if type(val)="roString" in particular).
Best however will be to define a test function for that and use it. That way code is most readable and fn can be updated in the future (or switch between the three different approaches in this thread). Here is mine:
Best however will be to define a test function for that and use it. That way code is most readable and fn can be updated in the future (or switch between the three different approaches in this thread). Here is mine:
function isString(val):
return getInterface(val, "ifString") <> invalid
end function