May 01, 2024, 05:30:26 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Change the "this" keyword

Started by Parker, January 16, 2006, 12:04:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Parker

This is a funny thing I discovered a while ago, the ability to change the "this" keyword in the compiler. You have to open acparse.exe in the IDE, search for "this" (find the lowercase one, not the "This program cannot...") and change it to "darn". Then in a new program, write this:
class test
{
int a;
declare m();
}
test::m()
{
*(test)darn.a = 1;
}

The code compiles without a problem :)

I just thought it was funny, but I don't recommend keeping that, you could break the compiler and you'd have to reinstall. Change it back to "this" when you're done, otherwise you'll get some "undefined variable: this" errors.

Ionic Wind Support Team

You would definately break the compiler doing things like that ;)

Speaking of 'this'.   It is now typed so no more type casting will be needed in the next update.

*(lexer)this.Blah() can now be expressed as this->blah();
Ionic Wind Support Team

Parker

Yes, I figured out that if you're replacing variables they have to be the exact same length as before. I just think it's funny that it's possible. I always make a backup copy though before I try anything like that.