Yes. See this forum thread - essentially using get_filename(piport) in your script. Well, that's returning the filename being read - from which you could of course determine the containing directory. That thread also talks about being able to do it inside a function defined within a SKILL file (rather than defining a global variable to determine where the file is) - which wasn't documented at the time. It is now documented in the SKILL Language User Guide, in a section headed "Read-time Evaluation" which says: Read-time Evaluation SKILL provides the read-time eval operator #. for evaluating expressions at read-time. When this operator is encountered, the expression following the dot is evaluated and the result of this evaluation replaces the #. For example, in the code below get_filename(piport) is evaluated at read-time and the results are inserted when the entire expression is compiled: procedure(printFileThisWasFrom() printf( "The file is:%s\n" #.get_filename(piport) ) ) If this function was defined within a file "code.il" then after the read-time evaluation, the expression would expand to the following, before being passed to the SKILL evaluator: procedure(printFileThisWasFrom() printf( "The file is:%s\n" "code.il" ) ) Regards, Andrew
↧