summaryrefslogtreecommitdiff
path: root/plugins/MirLua/docs
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-06-15 13:22:04 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-06-15 13:22:04 +0000
commit547ec570deb26f93fa4ab974a76c0e964a635586 (patch)
tree1faf753295780f76f841c80b57106ec508b86133 /plugins/MirLua/docs
parent779e5910d73c0b14454bcbce6206f77e139c8df8 (diff)
MirLua:
- added ansi/unicode support for some fields - added default value for GetContactSetting git-svn-id: http://svn.miranda-ng.org/main/trunk@14175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/docs')
-rw-r--r--plugins/MirLua/docs/examples/database.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/MirLua/docs/examples/database.lua b/plugins/MirLua/docs/examples/database.lua
index 33b6863322..93c17cb818 100644
--- a/plugins/MirLua/docs/examples/database.lua
+++ b/plugins/MirLua/docs/examples/database.lua
@@ -6,25 +6,23 @@ local db = require('m_database')
-- @param module The name of section
-- @param setting The name of setting
-- @return value The value
-db.WriteContactSetting(nil, 'MirLua', 'testByte', true)
db.WriteContactSetting(nil, 'MirLua', 'testNum', -2342)
-db.WriteContactSetting(nil, 'MirLua', 'testString', "Hello!")
--- 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
-local str = db.GetContactSetting(nil, 'MirLua', 'testString');
+-- @param default The value which will be returned if setting doesn't not exists
+local bValue = db.GetContactSetting(nil, 'MirLua', 'testByte');
-- print string value if bool value is true
-if db.GetContactSetting(nil, 'MirLua', 'testByte') then
- print(str)
+if bValue then
+ local sValue = db.GetContactSetting(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.DeleteContactSetting(nil, 'MirLua', 'testString');
-
-db.WriteContactSetting(nil, 'MirLua', 'ShowConsole', 1)
+db.DeleteContactSetting(nil, 'MirLua', 'testNum');