summaryrefslogtreecommitdiff
path: root/plugins/MirLua/docs/examples/database.lua
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-01-02 13:55:52 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-01-02 13:55:52 +0000
commit556ec5e59c94222224eb8a13c05d737b765b9259 (patch)
tree4669457199f30201918c1f975ccf635b1c9b85ba /plugins/MirLua/docs/examples/database.lua
parent0a79763db57ac830746fbb70f227ca2a0b758e49 (diff)
MirLua: linked with liblua
git-svn-id: http://svn.miranda-ng.org/main/trunk@15989 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/docs/examples/database.lua')
-rw-r--r--plugins/MirLua/docs/examples/database.lua49
1 files changed, 0 insertions, 49 deletions
diff --git a/plugins/MirLua/docs/examples/database.lua b/plugins/MirLua/docs/examples/database.lua
deleted file mode 100644
index 033293e5c7..0000000000
--- a/plugins/MirLua/docs/examples/database.lua
+++ /dev/null
@@ -1,49 +0,0 @@
---- include m_database module
-local db = require('m_database')
-
---- Iterate all contact stored in db
--- @param protoName The name of protocol account or nothing
-for hContact in db.AllContacts() do
- --print(hContact)
-end
-
-local hContact = 15
-
---- Iterate all contact events stored in db
--- param hContact The handle of contact
-for hEvent in db.AllEvents(hContact) do
- --print(hEvent)
-end
-
---- Iterate all setting names stored in db
--- param module The name of module
--- param hContact The handle of contact or nothing
-for setting in db.AllSettings('CList') do
- --print(setting)
-end
-
---- Save value to database
--- @param hContact The handle of contact (can be NULL)
--- @param module The name of section
--- @param setting The name of setting
--- @return value The value
-db.WriteSetting(nil, 'MirLua', 'testNum', -2342)
-
---- Return value from database
--- @param hContact The handle of contact (can be NULL)
--- @param module The name of section
--- @param setting The name of setting
--- @param default The value which will be returned if setting doesn't not exists
-local bValue = db.GetSetting(nil, 'MirLua', 'testByte');
-
--- print string value if bool value is true
-if bValue then
- local sValue = db.GetSetting(nil, 'MirLua', 'testString', 'Hello!')
- print(sValue)
- end
-
---- Delete value from database
--- @param hContact The handle of contact (can be NULL)
--- @param module The name of section
--- @param setting The name of setting
-db.DeleteSetting(nil, 'MirLua', 'testNum');