Jump to content

User talk:SemperBlotto

Page contents not supported in other languages.
From Wikipedia

Hi! Firstly, if you click on the 'script error' text, it shows you some more information. In your case it says "Script error: The module did not return a value. It is supposed to return an export table.". That means that your module didn't have a 'return' at the end which returns the table containing the functions and variables that you want to export from the module. CodeCat (talk) 15:50, 7 September 2012 (UTC)[reply]

  • So what is that "return pagename + cat" statement? SemperBlotto (talk) 15:59, 7 September 2012 (UTC)[reply]
    • That is the return value of the function itadv. But your module, itself, also needs to return values. For code 'outside' your module to use the functions you define in it, you need to return it to them. In a sense, a module is a function itself, one which defines other functions inside it and then returns them to whoever called it (which would be the template in this case). When you write {{#invoke:It|itadv}} in a template, what you are really doing is running the entire module as if it were a function, then taking the value it returns (which is nothing at all as of right now). The module's return value is then treated it as though it were a table, and the index itadv is selected from it, which is then itself called as a function. The value that returns is then put in place of the {{#invoke:It|itadv}} code. CodeCat (talk) 16:22, 7 September 2012 (UTC)[reply]
    • Wikipedia:Guide to Scribbling#Overall structure. Uncle G (talk) 17:41, 7 September 2012 (UTC)[reply]