In VBScript, you can use certain .net classes using COM automation. This comes in handy when you want to use dynamic arrays, lists, queues etc.
It would be nice if I could use strings as objects, so I could do all fancy string stuff with it, but whenever I pass a string from another object, it is seen by VBScript as a literal string and not as a string object:
Set s = CreateObject("System.Text.StringBuilder")
s.Append_3 "I love deadlines. I like the whooshing sound they make as they fly by."
' This gives me the literal string
MsgBox s.ToString
text = s.ToString
' But unfortunately this won't work
MsgBox s.ToString.Length
Set stringRef = s.ToString
Also creating a string as a COM object won't work:
Set s = CreateObject("System.String") ' Nope.
Is there someone who did manage this, or is having other thoughts about it?