Difference between pages "Module:Example" and "Module:Example/sandbox"
(Difference between pages)
Jump to navigation
Jump to search
m (9 revisions imported) |
m (1 revision imported) |
||
| Line 3: | Line 3: | ||
--Such variables can have whatever name you want and may | --Such variables can have whatever name you want and may | ||
--also contain various data as well as functions. | --also contain various data as well as functions. | ||
| − | p.hello = function( frame ) --Add a function to " | + | |
| + | p.hello = function( frame ) --Add a function to "my_object". | ||
--Such functions are callable in Wikipedia | --Such functions are callable in Wikipedia | ||
--via the #invoke command. | --via the #invoke command. | ||
--"frame" will contain the data that Wikipedia | --"frame" will contain the data that Wikipedia | ||
--sends this function when it runs. | --sends this function when it runs. | ||
| − | |||
local str = "Hello World!" --Declare a local variable and set it equal to | local str = "Hello World!" --Declare a local variable and set it equal to | ||
| Line 31: | Line 31: | ||
-- Like above, concatenate a bunch of strings together to produce | -- Like above, concatenate a bunch of strings together to produce | ||
-- a sentence based on the arguments given. | -- a sentence based on the arguments given. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
end | end | ||