News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
[WIP] MurgaLua Reference Tool
Author Message
Senior Member

Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: [WIP] MurgaLua Reference Tool - a little help?

Ok, I was correct in assuming that arg[0] always returns the full path to the script.
The problem comes from the way I was determining the directory path. If the script is run in the current directory as an argument to murgaLua, there is no directory separator (variable name demo_sep) in the string, and so it returns the name of the script instead.

Here's a quick fix to that, although it could probably be done better:

if string.find(arg[0],demo_sep) then
  demo_appdir=string.gsub(arg[0],"(.*)"..demo_sep..".*","%1") -- data directory

It hasn't been tested on Windows yet to see if demo_sep needs to be preceded by % or yet another backslash in string.find

08-21-2007 01:45 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
[WIP] MurgaLua Reference Tool - mikshaw - 07-10-2007, 05:00 PM
RE: [WIP] MurgaLua Reference Tool - a little help? - mikshaw - 08-21-2007 01:45 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: