When the /import command is used within a function or script, the parameters available in the function will be available in the script file.
Just don't declare them as :local or :global.
For example:
[a@mk] > :global myfunc do={ /import myfunc.rsc }
myfunc.rsc:
:put "passed parameters: $1 $2 $3"
Try it:
[a@mk] > $myfunc A B C
passed parameters: A B C
Script file loaded and executed successfully
[a@mk] >
Define an $import function and use that instead of /import and parameter passing to a script file is solved. Named parameters are also supported.
:global import do={ :global result; :set result; /import "$1.rsc"; :local r $result; :set result; :return $r}
The global variable $result is used keep the the return value of the script file until is returned by the $import function.
Has to be cleared before and after invoking the script to avoid "unexplainable" errors.
The only disturbing things are those "Script file loaded and executed successfully" messages. They appear and you don't know which file was loaded.