[JW Lua] Using library functions in Console
Robert Patterson
robert at robertgpatterson.com
Wed Jan 3 17:08:07 CET 2024
As you mentioned, a little-known Windows fact is that you can use "/" in
file paths, at least inside programs. (I'm not sure about the command line,
since it uses "/" for options, which is why we have "\" to begin with.) I
worked professionally on DOS and Windows systems for nearly 30 years and
never knew it until a year or so ago.
When you run a script in the Console, it should run in the identical
environment that it would run from a menu. You should not need to set
anything up differently. Let me know if that was not your experience.
On Sun, Dec 31, 2023 at 2:48 PM Aaron Sherber <aaron at sherber.com> wrote:
> My bad -- I neglected to double the backslashes in the path on Windows.
> Using single forward slashes also works.
>
> So in my case, this lets me do what I want:
>
> package.path = package.path ..
> ";c:\\users\\aaron\\documents\\projects\\lua-scripts\\src\\?.lua"
>
> Aaron.
>
>
>
>
> On Sun, Dec 31, 2023 at 12:51 PM Aaron Sherber <aaron at sherber.com> wrote:
>
>> Hi all,
>>
>> What's the correct way to configure things so that I can call library
>> functions from the Console? Ideally, I'd like to be able to use the same
>> syntax in Console scripts that I currently do while developing scripts for
>> the repo (e.g., local library = require("library.general_library")).
>>
>> I've got the repo cloned locally, and I've tried adding both the src path
>> and the src/library path to package.path in the RGP Lua System Prefix
>> dialog, but that hasn't worked for me.
>>
>> Thanks,
>> Aaron.
>>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20240103/a7660bc7/attachment.htm>
More information about the JWLua
mailing list