Say I have a function and a class like this:
[php]function B()
{
// stuff
}
class A
{
function A()
{
B();
}
}[/php]
How would I call B from inside an instance of class A? Doing it like I have in the example doesn't work :(
edit: The example was missing a () but the issue still stands.
You're missing the () after B on line 9.
[QUOTE=compwhiziitothemax;18248253]You're missing the () after B on line 9.[/QUOTE]
I'm not missing a () in my actual code, this was just an example. But thanks for spotting anyway.
I'd imagine it to be because function B is defined after class A.
But I'm not sure, haven't done any real coding in a while.
[QUOTE=bigdoggie;18248449]I'd imagine it to be because function B is defined after class A.
But I'm not sure, haven't done any real coding in a while.[/QUOTE]
In my actual code the function is defined first. I'll fix the OP though with this in mind.
Oh, alright then.
Why don't you post the actual code, instead of a stripped representation?
Perhaps you've missed something that we cannot see.
[QUOTE=bigdoggie;18248515]Oh, alright then.
Why don't you post the actual code, instead of a stripped representation?
Perhaps you've missed something that we cannot see.[/QUOTE]
Such as me calling the wrong function :downs:
Problem solved, I accept your boxes.
Sometimes the simplest errors are overlooked.
And as being a simple thing, you would not expect to err, regarding it.
It happens buddy, we've all been there, and will be there once again.
Sorry, you need to Log In to post a reply to this thread.