29-01-2021 09:04 AM
I have a series of interdependant LUA scripts, that also can be called individually. They take an array as parameter, and I need to pass the array down the chain when calling the scripts.
I have tried many different things, but keep getting the error: "43000:"import function: parameters of type userdata not supported" caught in script "MASTER_SCRIPT" at line 2" (adjusted to below example).
It I output the arrayParm it prints NULL - consistent with the "userdata" error message.
So how do I speficy the arrayParm in the import-statement call of the script_to_call.
CREATE OR REPLACE SCRIPT script_to_call (parm1, ARRAY arrayParm) AS
output('Success')
for i=1, #arrayParm do
output('Looping')
end
CREATE OR REPLACE SCRIPT master_script(parm1, ARRAY arrayParm) AS
import('SCRIPT_TO_CALL', 'test', parm1, ???arrayParm??)
Solved! Go to Solution.
29-01-2021 10:34 AM
Hi @bakka ,
I tried this and it ran through, but I probably didn´t yet understand the issue:
CREATE OR REPLACE SCRIPT script_to_call(parm1, ARRAY arrayParm) AS
output('Success')
for q=1, #arrayParm do
output('Looping')
end
/
CREATE OR REPLACE SCRIPT master_script(parm1, ARRAY arrayParm) AS
import('SCRIPT_TO_CALL', 'test', parm1, arrayParm)
output('done')
/
execute script master_script(1,array('test1','test2','test3')) with output;
29-01-2021 10:43 AM
I actually tried this but got the user data error. But your example works, so I must be doing something else wrong. Thanks
29-01-2021 10:34 AM
Hi @bakka ,
I tried this and it ran through, but I probably didn´t yet understand the issue:
CREATE OR REPLACE SCRIPT script_to_call(parm1, ARRAY arrayParm) AS
output('Success')
for q=1, #arrayParm do
output('Looping')
end
/
CREATE OR REPLACE SCRIPT master_script(parm1, ARRAY arrayParm) AS
import('SCRIPT_TO_CALL', 'test', parm1, arrayParm)
output('done')
/
execute script master_script(1,array('test1','test2','test3')) with output;
Then it's time to become part of a unique family! Discover helpful tips and support other Community members with your knowledge.
Sign In