Pretend the code starting at line 20 is another program in slot 0. When I try to use the code at the top, it gives me an error saying "Type mismatch in 1:9." Why won't this work?
I'm making more tests, but i finally managed to replicate the error:
When you call a function located on a different slot that uses a global array (array declared outside the function), the program for some reason will have issues on performing a modification of the array.
Your best bet is to make a dummy array inside the function to copy all the content of the source array.
The problem rise because "load" only write the content of the file on a page. Meanwhile, "use x" let you use common function that exist on that page. However, it doesn't create any instance of a global variable because the program is not executed. You need to use "exec" instead of "load" to execute those commands.
TLDR. Use exec "PRGX:FILE" instead of load and use if you want to use array in othe