Why is it that every now and then you throw out what appears to be a simple question that then turns out to be a horrible nightmare?
For the record, I grok nothing! NOTHING! [code] ...
I think i have good understanding what's going on - but it would be better if someone on RokuCo's payroll explains it, for couple of reasons.
I was hoping "s$" was super magical.
Yeah... no. I have seen people using type-suffixes (s$, i#) under the impression/hope that it produces more efficient code. It doesn't. What it does is to perform type check on every assignment to that variable and ensure the value is of the right type.
Let me see if I understand what you're asking, you want to be able to create a const string at runtime? ... and what fiendishly clever thing would this be used for?
Correct. And indeed i have a specific reason to ask - see String de-duper device
thread. In short, due to its verbogosity, after parsing an XML source there will be lots and lots of duplicate strings (lots of the same tag names and attribute names) taking up memory - which can be significant if parsing big file on small device. Using the functions from that thread will get rid of duplicates by replacing with references to a single string copy.
But what happens if further in the program you mutate one of the tags names? Then "automagically" all other places referring to that will also have their value changed. Which might be a feature but more often in practice is a bug. If there were a way to convert roString -> String though, i could use said "const strings" in the de-duper and trust a single change won't proliferate. (Because it won't allow calling .SetString()
on that, it'll force you to use `=` which will be a single change)