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

Most of them will work fine as-is, but those that use the images directory need the directory added to them (there are 7 or 8 of them, I think).

The old version of the demos package had all of the demos load as part of the main script. While this made some things more convenient, it caused porblems in other areas. The way it is now, any script that can run on its own can be dropped into the script directory without change. The only ones that need a helping hand are the ones that rely on external images.

In order to make the package as portable as possible, specifically so you can put it anywhere you want and not have to be *in* that directory when you run it, the images variable is dynamically set when the main script is run. When you run a demo, the code buffer is copied to a temp file (in order to use any changes you make) and that is run instead of the original script. Here's where the main problem came in...that temp file is no longer in the script directory, so it doesn't know where the images directory is. The main script passes the images variable to the temp demo. When you save the file and run it independently, the variable is not passed to it.

I *could* have saved the variable with every script, but that would be overkill since only a handful of the scripts actually use images.

I'm open to any suggestions for a better solution.

03-30-2008 08:35 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 - mikshaw - 03-30-2008 08:35 AM

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

Forum Jump: