More elaboration

This commit is contained in:
relt-1
2023-09-23 17:00:30 +02:00
parent b43b843f03
commit b7c22b3c7d
15 changed files with 130 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<script>
const documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html']
const namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Objects', 'QScript Tutorial Chapter 1']
const documentlist = ['/wiki/index.html', '/wiki/QScript/Introduction.html', '/wiki/QScript/Lua/Classes.html', '/wiki/QScript/Lua/Exports.html', '/wiki/QScript/Lua/Imports.html', '/wiki/QScript/Lua/Intro.html', '/wiki/QScript/Lua/Objects.html', '/wiki/QScript/Tutorial/Chapter1.html']
const namelist = ['Wiki Intro', 'QScript Intro', 'Lua Classes', 'Lua Exports', 'Lua Imports', 'Lua Intro', 'Lua Objects', 'QScript Tutorial Chapter 1']
function updateSearch() {
searchtext = document.getElementById("searchbox").value.toLowerCase();
@@ -48,8 +48,9 @@ pre {
<p>Let's say that you have made a file called "MyLib.lua" inside a mod called "MyMod". These are the contents of it:</p>
<pre><code>-- MyMod/MyLib.lua
function add(a,b)
<p><small style="position:relative; top:16px;">MyMod/MyLib.lua</small></p>
<pre><code>function add(a,b)
return a + b
end
@@ -65,6 +66,8 @@ MyLib.add(5,7) -- Will return 12
<p>Importing works between other languages. So you don't need to worry about a library being written in a different language than you would like. (You could even use multiple languages in one project! Think about that!)</p>
<p>The reason why you can't use tables, is because objects, are actually shared! One script can modify it (like set a variable), and every other script will also see the change. Tables differ between languages, meaning that having to manually sync them between eachother would be a bad idea. Here, you only get a "reference" to the object. Meaning that every script sees the <em>same</em> object, not copies of it.</p>
<hr />
<p><a href="/wiki/QScript/Lua/Exports.html">&lt;- Prev</a></p>