Quote:
Originally Posted by Chompy
If you can pinpoint things directly, lets say variable name being the same as the key order, why just not check if it exists?
Lets take a modular example, with great possibilities when it comes to expanding the concept as a system.
http://pastebin.com/A21Yc1sA
I had to pastebin it, since I got an Access Denied when trying to post the code.
I wrote it without testing it, but the general idea should be there. I also made it much bigger than it had to be, but it was fun. Could easily become something bigger, it's quite flexible if some more changes are done to it. Also made it so you have to enable the possibility of doing combos.
This code is not done at all, I just wrote it for this post to illustrate an example.
|
nice styling.
PHP Code:
temp.check = ((this.testcheck!=false)
? this.testcheck(this.test)
: this.check(this.test)
);
really. i know people that do this on the same line, but I can read it easier on separate lines (though it takes more discipline while writing it up because you might overlook a ) or } [for arrays, etc].
Plus, i don't have a fancy widescreen monitor so I tend to write in really thin-width windows. :P