summaryrefslogtreecommitdiff
path: root/array.lua
diff options
context:
space:
mode:
authorLua Team <team@lua.org>1993-07-28 12:00:00 +0000
committerrepogen <>1993-07-28 12:00:00 +0000
commit8b5979a7e8b9732aa2883d2384f853d87b594770 (patch)
treef2f23a63f14744c612f4cf2e52497352a3d8ef53 /array.lua
downloadlua-github-1.0.tar.gz
Lua 1.01.0
Diffstat (limited to 'array.lua')
-rw-r--r--array.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/array.lua b/array.lua
new file mode 100644
index 00000000..349fb818
--- /dev/null
+++ b/array.lua
@@ -0,0 +1,15 @@
+$debug
+
+a = @()
+
+i=0
+while i<10 do
+ a[i] = i*i
+ i=i+1
+end
+
+r,v = next(a,nil)
+while r ~= nil do
+ print ("array["..r.."] = "..v)
+ r,v = next(a,r)
+end