プレイ日記
Scientist Speedy1101
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?
1そうだね
プレイ済み
返信[1]
親投稿
Autz sonic-HD8765
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.
0そうだね
プレイ済み
返信[2]
親投稿
raimondz raimondzz
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
1そうだね
プレイ済み
返信[3]
親投稿
Scientist Speedy1101
So I need to execute the library program before the main one then I can call the starz function?
0そうだね
プレイ済み