Missing '\t' tab constant management (v2.6.0)
Hi,
This is a tiny contribution to be able to write tabs using '\t' in string or character constants in scripts.
Just go to as_compiler.cpp, in the ProcessStringConstant() method, line 4248 and adds the following two lines:
else if( cstr[n] == 't' )
str.PushLast('\t');
So you get:
...
else if( cstr[n] == 'r' )
str.PushLast('\r');
else if( cstr[n] == 't' )
str.PushLast('\t');
else if( cstr[n] == '0' )
str.PushLast('\0');
...
Notice I placed it between '\r' and '\0' but it could be added in other places.
Then you'll be able to write in your scripts something like:
...
string MyString = "\tThis text is tabbed.\n";
int tabChar = '\t';
...
Lbas
Thanks, I'll add this to the script library.
It's odd that nobody complained about it before, as it is a rather common escape char, or perhaps not as common as I thought. :)
It's odd that nobody complained about it before, as it is a rather common escape char, or perhaps not as common as I thought. :)
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement