🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Missing '\t' tab constant management (v2.6.0)

Started by
1 comment, last by Deyja 18 years, 1 month ago
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
Advertisement
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. :)

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Tab can be entered directly into the script, so the escape isn't totally neccessary. So no one complained because they just pressed tab instead.

This topic is closed to new replies.

Advertisement