{"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":"2026-09-23T11:19:46","modified_gmt":"2026-09-23T11:19:46","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>\n<tbody>\n<tr>\n<td><\/td>\n<td><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><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><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 8<\/strong><\/td>\n<td><strong>Notes<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Lua version<\/td>\n<td>5.1<\/td>\n<td>5.3.5<\/td>\n<td>5.3<\/td>\n<td>5.4 was released on 29 Jun 2020 but <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 stays on 5.3, so plugin code written for <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 runs unchanged.<\/td>\n<\/tr>\n<tr>\n<td>Lua build<\/td>\n<td>32-bit<\/td>\n<td>32-bit<\/td>\n<td>64-bit<\/td>\n<td><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 is a 64-bit application, so the Lua library DLLs it loads are all 64-bit builds. This only matters if you have used loadrequire or similar to pull in a DLL from outside 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> installation: a 32-bit DLL will not load 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>8. Pure-Lua modules are unaffected. Note also that 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>8\u00a0<code>fhGetAppVersion()<\/code>\u00a0returns a number, not a string; use\u00a0<code>tostring()<\/code>\u00a0before concatenating it.<\/td>\n<\/tr>\n<tr>\n<td>Lua reference and programming manuals<\/td>\n<td>Free online:\u00a0<a href=\"http:\/\/www.lua.org\/manual\/5.1\/\">Lua 5.1 Reference Manual<\/a>\u00a0Free online:\u00a0<a href=\"http:\/\/www.lua.org\/pil\/contents.html\">Programming in Lua (first edition)<\/a>\u00a0for Lua 5.0\u00a0<a href=\"https:\/\/www.amazon.co.uk\/Programming-Lua-Roberto-Ierusalimschy\/dp\/8590379825\">Programming in Lua 2nd edition<\/a>\u00a0at Amazon<\/td>\n<td colspan=\"2\">Free online:\u00a0<a href=\"https:\/\/www.lua.org\/manual\/5.3\/contents.html#contents\">Lua 5.3 Reference Manual<\/a>\u00a0Free online:\u00a0<a href=\"http:\/\/www.lua.org\/pil\/contents.html\">Programming in Lua (first edition)<\/a>\u00a0for Lua 5.0\u00a0<a href=\"https:\/\/www.amazon.co.uk\/Programming-Lua-fourth-Roberto-Ierusalimschy\/dp\/8590379868\">Programming in Lua 4th edition<\/a>\u00a0via Amazon<\/td>\n<td><a href=\"https:\/\/www.lua.org\/versions.html\">Lua version history<\/a>\u00a0has links to free online Reference Manuals for all versions\u00a0<a href=\"http:\/\/www.lua.org\/pil\/index.html\">Programming in Lua<\/a>\u00a0paperbacks (editions 2 to 4) are all available via Amazon in the country of your choice<\/td>\n<\/tr>\n<tr>\n<td>Lua Wiki (programming language information &amp; resources)<\/td>\n<td colspan=\"4\"><a href=\"http:\/\/lua-users.org\/wiki\/\">Lua Wiki ~ Main Page<\/a>\u00a0and\u00a0<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. 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. <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 ships the same set of libraries as <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, rebuilt as 64-bit DLLs, plus two new ones:\u00a0<a href=\"#lpeg\">LPeg<\/a>\u00a0and its\u00a0<code>re<\/code>\u00a0module. Several libraries are at a different version from <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 from the version stated in 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>8 Plugin Help); 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>8 column below shows the version actually reported by the library when loaded. The\u00a0<code>require<\/code>\u00a0lines shown for <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 all work unchanged 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>8.<\/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. 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>\n<tbody>\n<tr>\n<td><\/td>\n<td><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><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><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 8<\/strong><\/td>\n<td><strong>Make available by:<\/strong><\/td>\n<\/tr>\n<tr>\n<td>IUP version<\/td>\n<td>V5: 3.5 V6: 3.11.2<\/td>\n<td>3.28<\/td>\n<td>3.28 (64-bit)<\/td>\n<td><code>require (\"iuplua\")<\/code><\/td>\n<\/tr>\n<tr>\n<td>IUP reference manual and programming guides<\/td>\n<td colspan=\"4\">Free online:\u00a0<a href=\"http:\/\/www.tecgraf.puc-rio.br\/iup\/\">IUP Portable User Interface\u00a0<\/a>Read carefully to identify features that are not available in the version you are using.\u00a0<a href=\"http:\/\/www.luteus.biz\/Download\/LoriotPro_Doc\/LUA\/LUA_For_Windows\/iup\/iup.html\">A Basic Guide to using IupLua<\/a>\u00a0<a href=\"\/kb\/kb-article\/iup-gui-builder-hints-and-tips\/\">IUP GUI Builder Hints and Tips<\/a><\/td>\n<\/tr>\n<tr>\n<td rowspan=\"7\">Additional IUP Libraries<\/td>\n<td class=\"col0 leftalign\" colspan=\"3\" 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>\u00a0<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>\u00a0<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>\u00a0<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>\u00a0<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>\u00a0<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>\u00a0<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>\u00a0All are present 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 <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8.<\/td>\n<td class=\"col1 leftalign\"><code>require( \"iupluacontrols\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row4\">\n<td class=\"col1 leftalign\"><code>require( \"iupluagl\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row5\">\n<td class=\"col1 leftalign\"><code>require( \"iupluaglcontrols\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row6\">\n<td class=\"col1 leftalign\"><code>require( \"iuplua_mglplot\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row7\">\n<td class=\"col1 leftalign\"><code>require( \"iupluaole\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row8\">\n<td class=\"col1 leftalign\"><code>require( \"iuplua_scintilla\" )<\/code><\/td>\n<\/tr>\n<tr class=\"row9\">\n<td class=\"col1 leftalign\"><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\u00a0<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>\u00a0to use them within your plugin. Most of them\u00a0<strong>are<\/strong>\u00a0pre-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>7 and <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 and you do not need to use loadrequire. 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>\n<tbody>\n<tr>\n<td><\/td>\n<td><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><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><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 8<\/strong><\/td>\n<td><strong>Notes<\/strong><\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">Lua File System<\/td>\n<td>V6: 1.5<\/td>\n<td>1.7<\/td>\n<td>1.6.3 (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>8 Plugin Help says 1.7)<\/td>\n<td rowspan=\"2\"><code>require( \"lfs\" )<\/code><\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">Free online:\u00a0<a href=\"https:\/\/lunarmodules.github.io\/luafilesystem\/\">Lua File System Library Manual<\/a>\u00a0Note: lfs will not work with file names and paths that include UTF8 characters; use\u00a0<a href=\"#fhfileutils\">fhFileUtils<\/a>\u00a0for those.<\/td>\n<\/tr>\n<tr>\n<td>LuaCOM<\/td>\n<td colspan=\"3\">V6, V7, V8: 1.3 Free online:\u00a0<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>\u00a0Note: 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>8 LuaCOM is a 64-bit build, so it can only create 64-bit COM objects. Most Windows components (WScript.Shell, Excel, Word, Outlook, ADODB) have 64-bit versions; a plugin that relies on a 32-bit-only COM component will 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>8.<\/td>\n<td><code>require (\"luacom\")<\/code><\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\">IM: Digital Imaging Toolkit<\/td>\n<td class=\"col0 leftalign\">V5: 3.4.2 V6: 3.8.2<\/td>\n<td>3.13<\/td>\n<td>3.13<\/td>\n<td class=\"col1 leftalign\" rowspan=\"2\"><code>require( \"imlua\" ,<\/code>\u00a0<code>\"imlua_process\" )<\/code><\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">Free online:\u00a0<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 rowspan=\"2\">CD: 2-D Graphics library<\/td>\n<td>V5 and 6: Version tba<\/td>\n<td>5.12<\/td>\n<td>5.12<\/td>\n<td rowspan=\"2\"><code>require (\"cdlua\")<\/code><\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">Free online:\u00a0<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>MD5: Cryptographic library<\/td>\n<td class=\"col0 leftalign\" colspan=\"2\">V6, V7: 1.2 Free online:\u00a0<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>1.3 (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>8 Plugin Help says 1.2) The companion\u00a0<code>des56<\/code>\u00a0module is also present.<\/td>\n<td class=\"col1 leftalign\"><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>\u00a0loadrequire ( \"md5\" )<\/code>\u00a0<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 8:\u00a0<code>md5 = require (\"md5\")<\/code><\/td>\n<\/tr>\n<tr class=\"row5\">\n<td rowspan=\"2\">LuaSocket: Network support<\/td>\n<td class=\"col0 leftalign\">V5 and 6: tba<\/td>\n<td>2.0.2<\/td>\n<td>3.0.0 (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>8 Plugin Help says 2.0.2)<\/td>\n<td class=\"col1 leftalign\"><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:\u00a0<code>loadrequire ( \"socket\" )<\/code>\u00a0<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 8:\u00a0<code>socket = require (\"socket\")<\/code><\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">Free online:\u00a0<a class=\"urlextern\" title=\"https:\/\/lunarmodules.github.io\/luasocket\/\" href=\"https:\/\/lunarmodules.github.io\/luasocket\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">LuaSocket: Network support for Lua<\/a>\u00a0(3.0 reference; the older 2.0.2 manual is at\u00a0<a href=\"http:\/\/w3.impa.br\/~diego\/software\/luasocket\/\">w3.impa.br<\/a>) Note: LuaSocket provides plain HTTP only. Neither <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 nor <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 includes LuaSec (<code>ssl<\/code>), so HTTPS requests must be made another way, e.g. via LuaCOM and\u00a0<code>MSXML2.ServerXMLHTTP<\/code>\u00a0or\u00a0<code>WinHttp.WinHttpRequest.5.1<\/code>.<\/td>\n<td><\/td>\n<\/tr>\n<tr class=\"row6\">\n<td>LuaZip: Reading files inside zip files<\/td>\n<td class=\"col0 leftalign\">Free online:\u00a0<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 colspan=\"2\">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 or <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 On Windows 10 above build 17063, you can use Tar (to create compressed archives) and uncompress both gz and zip ones\u00a0<code>require 'luacom'<\/code>\u00a0<code>-- Unzip<\/code>\u00a0<code>sCmd = 'tar -xf \"L:\\\\fh_set_living.zip\" -C D:\\\\temp\\\\ '<\/code>\u00a0<code>-- Zip<\/code>\u00a0<code>sCmd = 'tar -cvzf \"d:\\\\temp\\\\doc.gz\" \"D:\\\\temp\\\\Doc\"'<\/code>\u00a0<code>Shell = luacom.CreateObject(\"WScript.Shell\")<\/code>\u00a0<code>Shell:Run (sCmd, 0, true)<\/code>\u00a0Note: this does not work in Crossover.<\/td>\n<td class=\"col1 leftalign\"><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:\u00a0<code>loadrequire( \"zip\" )<\/code>\u00a0<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 8: N\/A<\/td>\n<\/tr>\n<tr class=\"row7\">\n<td rowspan=\"2\">LuaSQL: DBMS interface<\/td>\n<td class=\"col0 leftalign\">V5 and 6: Version tba<\/td>\n<td colspan=\"2\">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 or <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 and the\u00a0<a href=\"#fhsql\">fhSQL<\/a>\u00a0library should be used instead. Note: <span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8 ships an\u00a0<code>lsqlite3.dll<\/code>\u00a0but\u00a0<code>require(\"lsqlite3\")<\/code>\u00a0fails to load it; use fhSQL.<\/td>\n<td class=\"col1\"><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 colspan=\"3\">Free online:\u00a0<a href=\"https:\/\/lunarmodules.github.io\/luasql\/\">LuaSql: DBMS interface for Lua<\/a><\/td>\n<td><\/td>\n<\/tr>\n<tr class=\"row8\">\n<td><a id=\"penlight\"><\/a>Penlight Lua Library Modules<\/td>\n<td class=\"col0 leftalign\">V5 and V6: 1.5.4 Free online:\u00a0<a href=\"http:\/\/stevedonovan.github.io\/Penlight\/api\/\">Penlight Lua Library version 1.5.4<\/a><\/td>\n<td colspan=\"2\">V7, V8: 1.8.0 Free documentation online:\u00a0<a href=\"https:\/\/lunarmodules.github.io\/Penlight\/\">Penlight Lua Libraries<\/a>\u00a0Changes from 1.8 to the current versions are documented\u00a0<a href=\"https:\/\/github.com\/lunarmodules\/Penlight\/blob\/master\/CHANGELOG.md\">here\u00a0<\/a>(mostly bugfixes)<\/td>\n<td class=\"col1\"><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:\u00a0<code>loadrequire( \"pl\", \"pl.init\" )<\/code>\u00a0<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 8:\u00a0<code>require (\"pl.init\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><a id=\"lpeg\"><\/a>LPeg: Parsing Expression Grammars for Lua<\/td>\n<td>N\/A<\/td>\n<td>N\/A<\/td>\n<td>1.1.0 Free online:\u00a0<a href=\"https:\/\/www.inf.puc-rio.br\/~roberto\/lpeg\/\">LPeg reference manual<\/a>\u00a0New 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>8 (not mentioned in 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>8 Plugin Help). A pattern-matching library that is far more capable than Lua&#8217;s built-in\u00a0<code>string.find<\/code>\/<code>string.match<\/code>: it can parse structured text such as GEDCOM lines, CSV, dates in mixed formats or citation strings with a proper grammar.<\/td>\n<td><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8:\u00a0<code>lpeg = require (\"lpeg\")<\/code><\/td>\n<\/tr>\n<tr>\n<td>re: regex-like syntax for LPeg<\/td>\n<td>N\/A<\/td>\n<td>N\/A<\/td>\n<td>Supplied with LPeg 1.1.0 Free online:\u00a0<a href=\"https:\/\/www.inf.puc-rio.br\/~roberto\/lpeg\/re.html\">LPeg re module manual<\/a>\u00a0New 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>8. A pure-Lua module (part of LPeg) that lets you write LPeg grammars in a compact, regular-expression-like notation, e.g.\u00a0<code>re.match(\"15 Mar 1852\", \"{%d+} ' ' {%a+} ' ' {%d+}\")<\/code>. It requires the\u00a0<code>lpeg<\/code>\u00a0module.<\/td>\n<td><span class=\"fh\" style=\"font-size: 17px !important; line-height: 21.4286px !important;\">\u0192<span style=\"color:#73B262; font-weight: bold;\">h<\/span><\/span>8:\u00a0<code>re = require (\"re\")<\/code><\/td>\n<\/tr>\n<tr>\n<td rowspan=\"2\"><a id=\"utf8\"><\/a>utf8: UTF-8 aware string functions<\/td>\n<td><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<\/td>\n<td><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<\/td>\n<td>Present; the module reports no version<\/td>\n<td 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:\u00a0<code>loadrequire( \"utf8\" )<\/code>\u00a0<code>loadrequire( \"compat53\" )<\/code>\u00a0Note: this order of requiring the modules is important. Additional code (see below) must be appended, depending on whether support is required for upper\/lower() of UTF-8 characters. <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, 7 and 8: a) If lower\/upper() support of UTF-8 characters is NOT needed:\u00a0<code>utf8 = require ( \".utf8\" ):init()<\/code>\u00a0b) If lower\/upper() support of UTF-8 characters IS needed:\u00a0<code>require ( \"utf8data\" )<\/code>\u00a0<code>utf8 = require ( \".utf8\" )<\/code>\u00a0<code>utf8.config[\"conversion\"] = { uc_lc = utf8_uc_lc; lc_uc = utf8_lc_uc; }<\/code>\u00a0<code>utf8:init()<\/code>\u00a0Note: if you wish to overlay the standard string library with this utf8 library, follow the initialisation call with\u00a0<code>for k,v in pairs(utf8) do\u00a0<\/code><code>string[k] = v<\/code>\u00a0<code>end<\/code><\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\"><a href=\"https:\/\/github.com\/Stepets\/utf8.lua\">Online documentation<\/a>\u00a0Note 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. 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\u00a0<a href=\"\/kb\/code-snippet\/module-require-with-load\/#subdirs\">here.<\/a>\u00a0In 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:\u00a0<code>require ( \"lfs\" )<\/code>\u00a0<code>local path = fhGetContextInfo(\"CI_APP_DATA_FOLDER\")..\"\\\\Plugins\\\\\"<\/code>\u00a0<code>if lfs.attributes(path..\"utf8data.lua\",\"mode\") ~= \"file\"<\/code>\u00a0<code>and lfs.attributes(path..\"utf8.lua\",\"mode\") == \"file\" then<\/code>\u00a0<code>os.remove(path..\"utf8.lua\")<\/code>\u00a0<code>end<\/code><\/td>\n<\/tr>\n<tr>\n<td><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>N\/A<\/td>\n<td>1.9\u00a0<a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhUtils.html\">Online Documentation<\/a><\/td>\n<td>1.16\u00a0<a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhUtils.html\">Online Documentation<\/a><\/td>\n<td><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 <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 8:\u00a0<code>require (\"fhUtils\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><a id=\"fhfileutils\"><\/a>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>N\/A<\/td>\n<td>1.0\u00a0<a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhFileUtils.html\">Online Documentation<\/a><\/td>\n<td>1.9\u00a0<a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhFileUtils.html\">Online Documentation<\/a><\/td>\n<td><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 <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 8:\u00a0<code>require(\"fhFileUtils\")<\/code><\/td>\n<\/tr>\n<tr>\n<td><a id=\"fhsql\"><\/a>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>N\/A<\/td>\n<td>1.0\u00a0<a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhSQL.html\">Online Documentation<\/a><\/td>\n<td>1.3\u00a0<a href=\"http:\/\/pluginstore.family-historian.co.uk\/fhutils\/files\/fhSQL.html\">Online Documentation<\/a><\/td>\n<td><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 8:\u00a0<code>require(\"fhSQL\")<\/code><\/td>\n<\/tr>\n<tr>\n<td>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\u00a0<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>Version 0.9\u00a0<a href=\"https:\/\/github.com\/keplerproject\/lua-compat-5.3\">Online documentation<\/a><\/td>\n<td colspan=\"2\">N\/A (not needed: <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 8 are Lua 5.3)<\/td>\n<td><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 (\"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","protected":false},"template":"","fh_version":[14,15,739,826],"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","fh_version-v8","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"}],"version-history":[{"count":3,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article\/10705\/revisions"}],"predecessor-version":[{"id":12032,"href":"https:\/\/www.fhug.org.uk\/kb\/wp-json\/wp\/v2\/kb_article\/10705\/revisions\/12032"}],"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}]}}