Well I have script that Semi-depends on another script. There are somethings that can be done with just the script I wrote, and other things that require a Script written by someone else. I was hoping there would be a way that I would be able to afford the limited use of just my scripts stuff if the other file isn't found. I already know how I would determine if the import was successful or not, but if the file doesn't exist then the script won't even be able to start to be able to handle the error it's self.
Why wouldn't the other script be found? Do you not have full control over what scripts are in your directory? That doesn't really make much sense to me since you can ensure that script be present.
> call test.ash
[COLOR="#ff0000"]test2.ash could not be found (test.ash, line 1)[/COLOR]
You could call the second script via a cli_execute() in a way that prevents cli_execute() from aborting the original script if it can't find the second script.
So, you have some function (s) that aren't integral to your scripts execution that depend on some other script, but without that other script you could do just as well without those functions.
Seems to me like your best bet would be to post your script with a "Requires These Scripts:" tag, or just copying the original code you need into your script (crediting the author, of course)
Actually you do. You have the choice of telling me what I have to have in my directories in order to use your script. You can package all of the necessary scripts in an archive file so that if I download yours I get the dependencies. You can copy their code into your file so long as you and your users accept the ethics of that and you are willing to support the copied code.
I kind of understand what you are thinking of - I once wrote code that used a different method of computation depending upon whether a third-party executable was available or not - but given that there are workarounds available I don't see a compelling reason to write ASH code in a similar fashion.