Wikipedia:Lua: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
kTidak ada ringkasan suntingan
Baris 1:
{{inuseyatim}}
{{Information page|WP:Lua}}
{{Namespaces}}
Baris 15:
Cara paling sederhana untuk menjalankan lua dari halaman wiki adalah:
 
{{#invoke:''modulenama namemodul''|''functionnama namefungsi''}}
 
Sebagai contoh, kita dapat menjalankan [[Modul:Pisang]] disini modul bananapisang memiliki satu fungsi bernama "hello".
 
* <code><nowiki>{{#invoke:pisang|hello}}</nowiki></code> &rarr; {{#invoke:pisang|hello}}
<!--
=== Using arguments ===
 
=== Menggunakan argumen ===
Arguments are passed to modules in the same way that they are passed to templates. Note, however, that the text after the first pipe character is always the function name; the first positional argument is the text after the ''second'' pipe.
 
Argumen pada modul bekerja dengan cara yang sama seperti pada templat, tetapi setelah karakter pipa pertama selalu berisi nama fungsi; argumen pertama adalah teks setelah tanda "pipa" kedua.
&#123;{#invoke:''module name''|''function name''|''first positional argument''|''second positional argument''|''named argument'' = ''value''}}
 
&#123;{#invoke:''modulenama namemodul''|''functionnama namefungsi''|''firstposisi positionalargumen argumentpertama''|''secondposisi positionalargumen argumentkedua''|''namedisi argumentargumen'' = ''value''}}
<!--
For example, in [[Module:BananasArgs]], the "hello" function greets different people depending on the first positional argument. It works like this:
* <code><nowiki>{{#invoke:BananasArgs|hello|Kate}}</nowiki></code> &rarr; {{#invoke:BananasArgs|hello|Kate}}