lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, Apr 5, 2014 at 1:09 PM,  <tonyp@acm.org> wrote:
> I don’t know if this has been discussed before but would it possible to add
> the starting (main) script's path in the default search of directories when
> doing ‘require’?  And, preferably as the first place to look.

We have in the NoteCase Pro API (written in C):

string Nc_Script_Path_Get()

Returns the path of the current script (.lua file path or path of
NoteCase Pro document, which contains the script).

So although I am not an advanced programmer, I'd guess that what you
suggest is possible. But it might better be done as part of a module,
in aid of keeping core Lua slim and trim. It's functionality not
everyone will need.

Best regards,

Paul

-- 
[Notice not included in the above original message:  The U.S. National
Security Agency neither confirms nor denies that it intercepted this
message.]