Doesn't the manual explicitly say somewhere that you can't define engine objects inside a function?? Also if you look at the manual page for strings:
http://manual.conitec.net/astring.htm
"Defines a global string pointer..."
It says GLOBAL there.

This is what I think will happen in the line
STRING* TestStr = "#100";
It defines a local string pointer and it's set to a pointer of a temporary char array. All attempts to use it as a string will most propably cause a crash.