Dear all, I have written the function below, which only checks if a given file exists or not, and I would like it to return the value stored into retValue. As far as I know, SKILL returns the value of the last line of code (is this correct ?). If I write the code as below, I will get the error: *** Error in routine eval: Message: *Error* eval: unbound variable - retValue However, if I replace retValue by retValue=isFileName(myFilePath) it will work,but, from my point of view, this is an example of ugly code, since I am evaluating the function twice. Is there another way to do this ? If the variable retValue retains always the correct value, why does it get unbound after the if instruction end ? Thanks in advance, José procedure(fileExists(myFilePath) let((retValue) retValue=isFileName(myFilePath) ; Test if the file exists ; Check if config file exists if((retValue==t) then printf("fileExists: File Exists !") else printf("fileExists: File does not Exist !") ); end if ); End letmypath retValue ; Return Value ); End procedure
↧