If you set a variable in function A and want to get it in function B, use global variables.

https://manual.zorro-project.com/aarray.htm