I tried this approach at the end of your utility and it failed:
There should be no need to modify my function in any way (that also applies to all of the functions posted in the subfunction library section of my site), instead, you should call the function with the necessary arguments, then use the return of the function in your program.
To explain, think about my function (or any subfunction) as just another in-built LISP function, and imagine that you have no access to the source code for my function.
Without access to the source code, you wouldn't know
how the function works, or be in any position to
edit the function definition, but you
do know that the function requires a number of arguments (or parameters) and will return a known result after performing some operation.
Compare this to how you would use the AutoLISP
getfiled function: you obviously don't have access to the source code for the
getfiled function (as it is defined in a compiled arx file), yet you know that the function requires four arguments (dialog title, default directory, file extension filter, bit-code), and will return a filename if the user selects a file.
In your code you might call the
getfiled function in the following way in order to prompt the user to select a Text File:
Notice how the above example sets the return of the
getfiled function to the variable 'file' for later use in the program.
Now consider using my
LM:GetFiles function.
As noted in the code header, my function requires three arguments (dialog title, default directory & file extension filter - much the same as the
getfiled function), and my function will return either a list of filenames or nil if the user pressed cancel or failed to select any files.
With this knowledge, you needn't know
how my function works (though of course it would be prudent to study it for learning purposes), but you can confidently call it in your program, knowing that the user will be presented with a file selection interface customised by the parameters you have passed to the function, and also knowing all of the possible return values for the function.
So, just like the
getfiled function, you can call my
LM:GetFiles function in the following way to prompt the user to select multiple Text files:
(setq filelist
(LM:GetFiles
"Select Text Files" "" "txt"))
However, having extensively described this particular example, consider that you are in fact implementing this logic for
every AutoLISP function that you are using in your program.
For every AutoLISP function, you know the parameters required by the function, and you know what the function will return when called in your program.
Consider the somewhat trivial functions, such as the
sqrt function: you have no access to know the exact method that the
sqrt function is using to calculate the square root of its argument, but you
do know that if you supply it will a valid numerical argument, the function will return the square root of that number, which you can then use in your program.