You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rgp-lua.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,6 +103,13 @@ _RGP Lua_ (starting in version 0.67) pre-loads the lua-cjson 2.1.0 library, whic
103
103
localcjson=require('cjson')
104
104
```
105
105
106
+
If you are writing a script to be deployed at the [Finale Lua](https://finalelua.com) website, you must wrap the call to `require` as follows:
107
+
108
+
```lua
109
+
localutils=require('library.utils')
110
+
localcjson=utils.require_embedded('cjson')
111
+
```
112
+
106
113
The json strings formatted by cjson are flat, containing no line feeds. If you wish to format them in human-readable format, you can use the built-in function [`prettyformatjson`](#prettyformatjson).
107
114
108
115
More information on how to use the cjson library is available here:
@@ -136,6 +143,13 @@ _RGP Lua_ (starting in version 0.68) pre-loads the luafilesystem library ('lfs')
136
143
locallfs=require('lfs')
137
144
```
138
145
146
+
If you are writing a script to be deployed at the [Finale Lua](https://finalelua.com) website, you must wrap the call to `require` as follows:
147
+
148
+
```lua
149
+
localutils=require('library.utils')
150
+
locallfs=utils.require_embedded('lfs')
151
+
```
152
+
139
153
More information on how to use the lfs libray is available here:
@@ -149,6 +163,13 @@ _RGP Lua_ does not load the library into a global namespace, however. You must e
149
163
localosutils=require('luaosutils')
150
164
```
151
165
166
+
If you are writing a script to be deployed at the [Finale Lua](https://finalelua.com) website, you must wrap the call to `require` as follows:
167
+
168
+
```lua
169
+
localutils=require('library.utils')
170
+
localosutils=utils.require_embedded('luaosutils')
171
+
```
172
+
152
173
The advantage to this approach is that you do not need to change the body of your script if you wish to use an external version of `luaosutils` instead of the version embedded in _RGP Lua_. Simply disable the `LoadLuaOSUtils` option in [`plugindef`](#connect-to-finalelua) and the script will pick up the external version instead, provided it is in your `cpath` list. (_RGP Lua_ automatically adds the script’s running folder path to the `cpath` list.)
153
174
154
175
A script must be running as trusted code to gain full access to the functions in the library. See the [readme file](https://github.com/finale-lua/luaosutils#readme) for details.
0 commit comments