词条 | Module:Sandbox/xiaphias/maritime row |
释义 | my_object = {}; --All lua modules on Wikipedia must begin by defining a variable --that will hold their externally accessible functions. --Such variables can have whatever name you want and may --also contain various data as well as functions. my_object.hello = function( frame ) --Add a function to "my_object". --Such functions are callable in Wikipedia --via the #invoke command. --"frame" will contain the data that Wikipedia --sends this function when it runs. local str = frame.args[1] or "dat" --Declare a local variable and set it equal to --"Hello World!". return str --This tells us to quit this function and send the information in --"str" back to Wikipedia. end -- end of the function "hello" return my_object |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。