打开/关闭菜单
Toggle preferences menu
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模块:Helloworld:修订间差异

来自医林拾薪
(创建页面,内容为“local p = {}; --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. p.hello = function( frame ) --Add a function to "p". --Such functions are callable in Wikipedia…”)
 
无编辑摘要
 
(未显示同一用户的6个中间版本)
第9行: 第9行:
                                         --sends this function when it runs.  
                                         --sends this function when it runs.  
                                 -- 'Hello' is the name of your choice. The same name needs to be referred to when the module is used.
                                 -- 'Hello' is the name of your choice. The same name needs to be referred to when the module is used.
      
     return "Hello World!"..frame.args['title']   --This tells us to quit this function and send the information in
    local str = "Hello World!"  --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.
                   --"str" back to Wikipedia.
 
      
      
end  -- end of the function "hello"
end  -- end of the function "hello"
return p

2023年7月15日 (六) 03:56的最新版本

可在模块:Helloworld/doc创建此模块的帮助文档

脚本错误:Lua错误:无法创建进程:proc_open(/home/pi/LUA/error.log): Failed to open stream: 权限不够

local p = {};     --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.
p.hello = function( frame )     --Add a function to "p".  
                                        --Such functions are callable in Wikipedia
                                        --via the #invoke the command.
                                        --"frame" will contain the data that Wikipedia
                                        --sends this function when it runs. 
                                 -- 'Hello' is the name of your choice. The same name needs to be referred to when the module is used.
    return "Hello World!"..frame.args['title']    --This tells us to quit this function and send the information in
                  --"str" back to Wikipedia.
  
    
end  -- end of the function "hello"

return p