Quote:
Originally Posted by xAndrewx
Do you test anything you say?
PHP Code:
function onCreated() { temp.testA = 0; temp.myTest = "|hia"; testA = "lol"; this.onTest(); scheduleevent(3, "Test", ""); } function onTest() { echo(temp.myTest); echo(testA); }
Constantly returns "lol".
|
I just tried that, I don't get anything echoed. You've obviously made a mistake before that current compilation.
Variable names are case sensitive so you probably messed up the name of
temp.testA and the name didn't match the name of
testA = "lol";
Static variables appear to be an exception to this case-sensitive thing though.
PHP Code:
function onCreated() {
temp.r = 0;
r = "HELLO!";
echo(temp.r);
}
This script echos "HELLO!";
I've already extensively tested this and the only mistake I made was when I thought
temp.variable; automatically initialized it to zero. Your input is not going to change anything.
Also another reason I want the custom object types, so I can have my own static and read-only variables.
Btw, I recommend the avoidance of any uppercase letters in variable names, object names not included of course.