I have a function that takes arguments:
function top (Page p, Entry[] e, Comment[] cs)
And I would like to not have the argument for Entry[] if the function is called from EntryPage, and not to have Comment[] if it's called from Recent/Friends. Is it possible? I tried this, but am getting an error message ("Expected identifier"):
function
(
Read more... )
Comments 7
and
top($this, null, $this.comments);
I would have thought.
Reply
function Page::print_entry (Entry e)
{
print_entry($this, $e, null Color, null Color, false);
}
Reply
Glad you got it sorted in the end.
Reply
function RecentPage::lay_spammertop() {
top($this, $this.entries, null Comment[]);
}
function EntryPage::lay_spammertop() {
top($this, null Entry[], $this.comments);
}Looks pretty much the same, right?
Hint: Look at square brackets! :)
Can I, please, get a short description of what You have done with our function? Looks interesting.
Reply
Regarding your suggestion, I actually tried it at first, but it gave me this error:
"Unknown function top(RecentPage,Entry[],Comment,void[])"
--
I've just tried something that worked. So I will show you what I did. I doubt the comment will fit in all the code. Here's an entry I made - filtered to you (feel free to repost it anywhere): http://www.livejournal.com/users/camomiletea/67600.html
Reply
Reply
I've had the same problem with null. I don't know why it works on Color, but refuses on any other type.
Mkay, "empty" is a good solution. Didn't know that. Thank You for that too. :)
Reply
Leave a comment