{"id":10705,"date":"2020-07-07T13:28:46","date_gmt":"2020-07-07T13:28:46","guid":{"rendered":"https:\/\/fhug.org.uk\/kb\/?post_type=kb_article&#038;p=10705"},"modified":"2025-05-24T15:48:47","modified_gmt":"2025-05-24T15:48:47","slug":"lua-references-and-library-modules","status":"publish","type":"kb_article","link":"https:\/\/www.fhug.org.uk\/kb\/kb-article\/lua-references-and-library-modules\/","title":{"rendered":"Lua References and Library Modules"},"content":{"rendered":"<h2>Lua Language References<\/h2>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 15%;\"><\/td>\n<td style=\"width: 12.5%;\"><strong><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> versions 5 &amp; 6<\/strong><\/td>\n<td style=\"width: 12.5%;\"><strong><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> version 7<\/strong><\/td>\n<td style=\"width: 25%;\"><strong>Notes<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\">Lua version<\/td>\n<td style=\"width: 12.5%;\">5.1<\/td>\n<td style=\"width: 12.5%;\">5.3.5<\/td>\n<td style=\"width: 25%;\">5.4 was released on 29 Jun 2020<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\">Lua reference and programming manuals<\/td>\n<td style=\"width: 12.5%;\">Free online: <a href=\"http:\/\/www.lua.org\/manual\/5.1\/\">Lua 5.1 Reference Manual<\/a><\/p>\n<p>Free online: <a href=\"http:\/\/www.lua.org\/pil\/contents.html\">Programming in Lua (first edition)<\/a> for Lua 5.0<\/p>\n<p><a href=\"https:\/\/www.amazon.co.uk\/Programming-Lua-Roberto-Ierusalimschy\/dp\/8590379825\">Programming in Lua 2nd edition<\/a> at Amazon<\/td>\n<td style=\"width: 12.5%;\">Free online: <a href=\"https:\/\/www.lua.org\/manual\/5.3\/contents.html#contents\">Lua 5.3 Reference Manual<\/a><\/p>\n<p>Free online: <a href=\"http:\/\/www.lua.org\/pil\/contents.html\">Programming in Lua (first edition)<\/a> for Lua 5.0<\/p>\n<p><a href=\"https:\/\/www.amazon.co.uk\/Programming-Lua-fourth-Roberto-Ierusalimschy\/dp\/8590379868\">Programming in Lua 4th edition<\/a> at via Amazon<\/td>\n<td style=\"width: 25%; vertical-align: top;\"><a href=\"https:\/\/www.lua.org\/versions.html\">Lua version history<\/a> has links to free online Reference Manuals for all versions<\/p>\n<p><a href=\"http:\/\/www.lua.org\/pil\/index.html\">Programming in Lua<\/a> paperbacks (editions 2 to 4) are all available via Amazon in the country of your choice<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\">Lua Wiki<br \/>\n(programming language information &amp; resources)<\/td>\n<td style=\"width: 12.5%;\" colspan=\"3\"><a href=\"http:\/\/lua-users.org\/wiki\/\"><span style=\"font-family: inherit; font-size: inherit;\">Lua Wiki ~ Main Page<\/span><\/a>\u00a0and <a href=\"http:\/\/lua-users.org\/wiki\/SampleCode\">Lua Wiki ~ Sample Code<\/a>. Note: There will be elements of the advice and sample code that apply only to the later versions of Lua, not 5.1.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Lua Library Modules<\/h2>\n<p>Although Lua is deliberately written to be a small and simple language, it is extremely extensible by means of Library Modules that provide additional functionality.\u00a0 A number of such libraries are available for use (if wanted) within <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> plugins. We recommend that you &#8216;require&#8217; the libraries you&#8217;re going to use at the global level in your code, so they are all together and used just once. There is a marginal performance hit from doing this, but in most cases, the increase in code simplicity outweighs the disadvantages.<\/p>\n<h2><a id=\"iup\"><\/a>IUP GUI Builder<\/h2>\n<p>This is a pre-installed library used by <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> plugins when they need to present a user interface more complex than the simple message box and prompts provided by the <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> API.\u00a0 The version supported by <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> is often not the latest available, and can be hard to determine; where we&#8217;re uncertain we haven&#8217;t specified a version but you would be wise to remember this when debugging. You should also be careful to check which version of a library the online Documentation refers to, and consult the associated History page to understand the changes between the version provided in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> and the current version.<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 15%;\"><\/td>\n<td style=\"width: 12.5%;\"><strong><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> versions 5 &amp; 6<\/strong><\/td>\n<td style=\"width: 12.5%;\"><strong><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> version 7<\/strong><\/td>\n<td style=\"width: 25%;\"><strong>Make available by:<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%; vertical-align: middle;\">IUP version<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">V5: 3.5<\/p>\n<p>V6: 3.11.2<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">3.28<\/td>\n<td style=\"width: 25%; vertical-align: top;\"><code>require (\"iuplua\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%; vertical-align: middle;\">IUP reference manual and programming guides<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\" colspan=\"3\">Free online: <a href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/\">IUP Portable User Interface\u00a0<\/a><\/p>\n<p>Read carefully to identify features that are not available in the version you are using.<\/p>\n<p><a href=\"http:\/\/www.luteus.biz\/Download\/LoriotPro_Doc\/LUA\/LUA_For_Windows\/iup\/iup.html\">A Basic Guide to using IupLua<\/a><\/p>\n<p><a href=\"https:\/\/fhug.org.uk\/kb\/kb-article\/iup-gui-builder-hints-and-tips\/\">IUP GUI Builder Hints and Tips<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%; vertical-align: middle;\" rowspan=\"7\">Additional IUP Libraries<\/td>\n<td class=\"col0 leftalign\" style=\"vertical-align: top;\" colspan=\"2\" rowspan=\"7\"><a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/iupcontrols.html\" href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/iupcontrols.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IupControls<\/a><br \/>\n<a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iupglcanvas.html\" href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iupglcanvas.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IupGLCanvas<\/a><br \/>\n<a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/iupglcontrols.html\" href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/iupglcontrols.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IupGLControls<\/a><br \/>\n<a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iup_mglplot.html\" href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iup_mglplot.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IupMglPlot<\/a><br \/>\n<a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iupole.html\" href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iupole.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IupOleControl<\/a><br \/>\n<a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iup_scintilla.html\" href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iup_scintilla.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IupScintilla<\/a><br \/>\n<a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iupweb.html\" href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/en\/ctrl\/iupweb.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IupWebBrowser<\/a><\/td>\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><code>require( \"iupluacontrols\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row4\">\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><code>require( \"iupluagl\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row5\">\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><code>require( \"iupluaglcontrols\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row6\">\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><code>require( \"iuplua_mglplot\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row7\">\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><code>require( \"iupluaole\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row8\">\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><code>require( \"iuplua_scintilla\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row9\">\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><code>require( \"iupluaweb\" )<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Other Lua Library Modules<\/h2>\n<p>Not all these libraries are pre-installed in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> Versions 5 or 6; you may need to use the <a class=\"wikilink1\" title=\"plugins:code_snippets:module_require_with_load\" href=\"https:\/\/www.fhug.org.uk\/wiki\/doku.php?id=plugins:code_snippets:module_require_with_load\">Module Require With Load (code snippet)<\/a> to use them within your plugin.\u00a0 Most of them <strong>are<\/strong> pre-installed in [fh]7 and you do not need to use loadrequire.<\/p>\n<p>The versions supported by <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> are often not the latest available, and can be hard to determine; where we&#8217;re uncertain we haven&#8217;t specified a version but you would be wise to remember this when debugging. You should also be careful to check which version of a library the online Documentation refers to, and consult the associated History page to understand the changes between the version provided in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> and the current version.<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 15%;\"><\/td>\n<td style=\"width: 12.5%;\"><strong><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> versions 5 &amp; 6<\/strong><\/td>\n<td style=\"width: 12.5%;\"><strong><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> version 7<\/strong><\/td>\n<td style=\"width: 25%;\"><strong>Notes<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%; vertical-align: middle;\" rowspan=\"2\">Lua File System<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">V6: 1.5<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">1.7<\/td>\n<td style=\"width: 25%; vertical-align: top;\" rowspan=\"2\"><code>require( \"lfs\" )<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; vertical-align: top;\" colspan=\"2\">Free online: <a href=\"https:\/\/lunarmodules.github.io\/luafilesystem\/\">Lua File System Library Manual<\/a><\/p>\n<p>Note: lfs will not work with file names and paths that include UTF8 characters.<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%; vertical-align: middle;\">LuaCOM<\/td>\n<td style=\"width: 25%; vertical-align: top;\" colspan=\"2\">V6, V7: 1.3<\/p>\n<p>Free online: <a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/~rcerq\/luacom\/pub\/1.3\/luacom-htmldoc\/\" href=\"http:\/\/www.tecgraf.puc-rio.br\/~rcerq\/luacom\/pub\/1.3\/luacom-htmldoc\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">LuaCOM User Manual Version 1.3<\/a><\/td>\n<td style=\"width: 25%; vertical-align: top;\"><code>require (\"luacom\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%; vertical-align: middle;\" rowspan=\"2\">IM: Digital Imaging Toolkit<\/td>\n<td class=\"col0 leftalign\" style=\"width: 12.5%; vertical-align: top;\">V5: 3.4.2<\/p>\n<p>V6: 3.8.2<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">3.13<\/p>\n<p>&nbsp;<\/td>\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\" rowspan=\"2\"><code>require( \"imlua\" ,<\/code><br \/>\n<code>\"imlua_process\" )<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; vertical-align: top;\" colspan=\"2\">Free online: <a class=\"urlextern\" title=\"http:\/\/www.tecgraf.puc-rio.br\/im\/\" href=\"http:\/\/www.tecgraf.puc-rio.br\/im\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">IM &#8211; Digital Imaging Tool Version<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%; vertical-align: middle;\" rowspan=\"2\">CD: 2-D Graphics library<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">V5 and 6: Version tba<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">5.12<\/td>\n<td style=\"width: 25%; vertical-align: top;\" rowspan=\"2\"><code>require (\"cdlua\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top; width: 12.5%;\" colspan=\"2\">Free online: <a href=\"http:\/\/webserver2.tecgraf.puc-rio.br\/cd\/\">CD &#8211; A 2D Graphics Library<\/a><\/td>\n<\/tr>\n<tr class=\"row4\">\n<td style=\"width: 15%;\">MD5: Cryptographic library<\/td>\n<td class=\"col0 leftalign\" style=\"width: 12.5%; vertical-align: top;\" colspan=\"2\">V6, V7: 1.2<\/p>\n<p>Free online: <a class=\"urlextern\" title=\"https:\/\/lunarmodules.github.io\/md5\/\" href=\"https:\/\/lunarmodules.github.io\/md5\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">MD5: Cryptographic Library for Lua<\/a><\/td>\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>5 and 6:<code> loadrequire ( \"md5\" )<\/code><\/p>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7: <code>md5 = require (\"md5\")<\/code><\/td>\n<\/tr>\n<tr class=\"row5\">\n<td style=\"width: 15%;\" rowspan=\"2\">LuaSocket: Network support<\/td>\n<td class=\"col0 leftalign\" style=\"width: 12.5%; vertical-align: top;\">V5 and 6:\u00a0 tba<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">2.0.2<\/td>\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>5 and 6: <code>loadrequire ( \"socket\" )<\/code><\/p>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7: <code>socket = require (\"socket\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; vertical-align: top;\" colspan=\"2\">Free online: <a class=\"urlextern\" title=\"http:\/\/w3.impa.br\/~diego\/software\/luasocket\/\" href=\"http:\/\/w3.impa.br\/~diego\/software\/luasocket\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">LuaSocket: Network support for Lua<\/a><\/td>\n<td style=\"width: 25%; vertical-align: top;\"><\/td>\n<\/tr>\n<tr class=\"row6\">\n<td style=\"width: 15%;\">LuaZip: Reading files inside zip files<\/td>\n<td class=\"col0 leftalign\" style=\"width: 12.5%; vertical-align: top;\">Free online: <a class=\"urlextern\" title=\"http:\/\/mpeterv.github.io\/luazip\/\" href=\"http:\/\/mpeterv.github.io\/luazip\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">LuaZip: Reading files inside zip files<\/a><\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">Not supported in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7.0.0<\/p>\n<p>On Windows 10 above build 17063, you can use Tar (to create compressed archives) and uncompress both gz and\u00a0<span class=\"posthilit\">zip<\/span> ones<\/p>\n<p><code>require 'luacom'<\/code><br \/>\n<code>-- Unzip<\/code><br \/>\n<code>sCmd = 'tar -xf \"L:\\\\fh_set_living.<span class=\"posthilit\">zip<\/span>\" -C D:\\\\temp\\\\ '<\/code><br \/>\n<code>--\u00a0<span class=\"posthilit\">Zip<\/span><\/code><br \/>\n<code>sCmd = 'tar -cvzf \"d:\\\\temp\\\\doc.gz\" \"D:\\\\temp\\\\Doc\"'<\/code><\/p>\n<p><code>Shell = luacom.CreateObject(\"WScript.Shell\")<\/code><br \/>\n<code>Shell:Run (sCmd, 0, true)<\/code><\/p>\n<p>Note: this does not work in Crossover.<\/td>\n<td class=\"col1 leftalign\" style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>5 and 6: <code>loadrequire( \"zip\" )<\/code><\/p>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7: N\/A<\/td>\n<\/tr>\n<tr class=\"row7\">\n<td style=\"width: 15%;\" rowspan=\"2\">LuaSQL: DMBS interface<\/td>\n<td class=\"col0 leftalign\" style=\"width: 12.5%; vertical-align: top;\">V5 and 6: Version tba<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">LuaSQl does not work in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7 and the fhSQL library should be used instead.<\/td>\n<td class=\"col1\" style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6:\u00a0<code>loadrequire( \"luasql\", \"luasql.sqlite3\" )<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 25%; vertical-align: top;\" colspan=\"2\">Free online: <a href=\"https:\/\/lunarmodules.github.io\/luasql\/\">LuaSql: DBMS interface for Lua<\/a><\/td>\n<td style=\"width: 25%; vertical-align: top;\"><\/td>\n<\/tr>\n<tr class=\"row8\">\n<td style=\"width: 15%;\"><a id=\"penlight\"><\/a>Penlight Lua Library Modules<\/td>\n<td class=\"col0 leftalign\" style=\"width: 12.5%; vertical-align: top;\">V5 and V6: 1.5.4<\/p>\n<p>Free online: <a href=\"http:\/\/stevedonovan.github.io\/Penlight\/api\/\">Penlight Lua Library version 1.5.4<\/a><\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">1.8<\/p>\n<p>Free documentation online: <a href=\"https:\/\/lunarmodules.github.io\/Penlight\/\">Penlight Lua Libraries<\/a><\/p>\n<p>Changes from 1.8 to the current versions are documented <a href=\"https:\/\/github.com\/lunarmodules\/Penlight\/blob\/master\/CHANGELOG.md\">here <\/a>(mostly bugfixes)<\/td>\n<td class=\"col1\" style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>5 and 6: <code>loadrequire( \"pl\", \"pl.init\" )<\/code><\/p>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7: <code>require (\"pl.init\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\" rowspan=\"2\"><a id=\"utf8\"><\/a>utf8: UTF-8 aware string functions<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6: dated 2021-08-11<\/p>\n<p>&nbsp;<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7: dated 2021-08-11<\/p>\n<p>&nbsp;<\/td>\n<td style=\"width: 25%; vertical-align: top;\" rowspan=\"2\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6:<\/p>\n<p><code>loadrequire( \"utf8\" )<\/code><br \/>\n<code>loadrequire( \"compat53\" )<\/code><code><\/code><code><\/code><\/p>\n<p>Note: this order of requiring the modules is important. Additional code (see below) must be appended, depending on whether support is required for upper\/lower()\u00a0 of UTF-8 characters.<\/p>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6 and 7:<\/p>\n<p>a) If lower\/upper() support of UTF-8 characters is NOT needed:<\/p>\n<p><code>utf8 = require ( \".utf8\" ):init()<\/code><\/p>\n<p>b) If lower\/upper() support of UTF-8 characters IS needed:<\/p>\n<p><code>require ( \"utf8data\" )<\/code><br \/>\n<code>utf8 = require ( \".utf8\" )<\/code><br \/>\n<code>utf8.config[\"conversion\"] = { uc_lc = utf8_uc_lc; lc_uc = utf8_lc_uc; }<\/code><br \/>\n<code>utf8:init()<\/code><\/p>\n<p>Note: if you wish to overlay the standard string library with this utf8 library, follow the initialisation call with<\/p>\n<p><code>for k,v in pairs(utf8) do\u00a0<\/code><br \/>\n<code>\u00a0 string[k] = v<\/code><br \/>\n<code>end<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 12.5%; vertical-align: top;\" colspan=\"2\"><a href=\"https:\/\/github.com\/Stepets\/utf8.lua\">Online documentation<\/a><\/p>\n<p>Note 1: in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6 the library compat53 is a prerequisite for this library.<\/p>\n<p>Note 2: in <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6 you must loadrequire this library using the &#8216;multiple sub-directories&#8217; version of loadrequire <a href=\"https:\/\/fhug.org.uk\/kb\/code-snippet\/module-require-with-load\/#subdirs\">here.<\/a><\/p>\n<p>In addition, if you have written a plugin that requires upper\/lower support for UTF-8 characters, you need to check for and remove an earlier version of the library before you loadrequire it, with the following code:<\/p>\n<p><code>require ( \"lfs\" )<\/code><br \/>\n<code>local path = fhGetContextInfo(\"CI_APP_DATA_FOLDER\")..\"\\\\Plugins\\\\\"<\/code><br \/>\n<code>if lfs.attributes(path..\"utf8data.lua\",\"mode\") ~= \"file\"<\/code><br \/>\n<code>and lfs.attributes(path..\"utf8.lua\",\"mode\") == \"file\" then<\/code><br \/>\n<code>\u00a0 \u00a0os.remove(path..\"utf8.lua\")<\/code><br \/>\n<code>end<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\"><a id=\"fhutils\"><\/a>fhUtils: An <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> specific library module that provides utility functions for building <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> plugins.<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">N\/A<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">1.9<\/p>\n<p><a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhUtils.html\">Online Documentation<\/a><\/td>\n<td style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6: Not available<\/p>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7:<\/p>\n<p><code>require (\"fhUtils\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\">fhFileUtils: An <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> specific library of modules to handle files with Unicode file names that are not supported by the standard Lua LFS and IO methods.<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">N\/A<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">1.0<\/p>\n<p><a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhFileUtils.html\">Online Documentation<\/a><\/td>\n<td style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6: Not available<\/p>\n<span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7:<\/p>\n<p><code>require(\"fhFileUtils\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\">fhSQL: An <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span> specific library to handle database access<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\"><\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">1.0<\/p>\n<p><a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhSQL.html\">Online Documentation<\/a><\/td>\n<td style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>7:<\/p>\n<p><code>require(\"fhSQL\")<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"width: 15%;\">compat53 : A small module that aims to make it easier to write code in a Lua-5.3-style that is compatible with Lua 5.1, Lua 5.2, and Lua 5.3. This does <em>not<\/em>\u00a0make Lua 5.2 (or even Lua 5.1) entirely compatible with Lua 5.3, but it brings the API closer to that of Lua 5.3.<\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">Version 0.9<\/p>\n<p><a href=\"https:\/\/github.com\/keplerproject\/lua-compat-5.3\">Online documentation<\/a><\/td>\n<td style=\"width: 12.5%; vertical-align: top;\">N\/A<\/td>\n<td style=\"width: 25%; vertical-align: top;\"><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>6: <code>loadrequire (\"compat53\")<\/code><\/p>\n<blockquote><p><code>compat53<\/code>\u00a0makes changes to your global environment and does not return a meaningful return value, so the usual idiom of storing the return of\u00a0<code>require<\/code>\u00a0in a local variable makes no sense.<\/p><\/blockquote>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><\/h2>\n","protected":false},"template":"","fh_version":[14,15,739],"skill_level":[18,17],"topic":[73],"class_list":["post-10705","kb_article","type-kb_article","status-publish","hentry","fh_version-v5","fh_version-v6","fh_version-v7","search_term-cdlua","search_term-imlua","search_term-iuplua","search_term-lfs","search_term-pl-init","search_term-utf8","search_term-utf8data","skill_level-advanced","skill_level-intermediate","topic-writing-plugins"],"_links":{"self":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article\/10705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article"}],"about":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/types\/kb_article"}],"wp:attachment":[{"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/media?parent=10705"}],"wp:term":[{"taxonomy":"fh_version","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/fh_version?post=10705"},{"taxonomy":"skill_level","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/skill_level?post=10705"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/topic?post=10705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}