Access a variable from one function inside another function
Posted: 20 Feb 2018, 13:24
Here are 2 functions, the 1st is called inside 2nd. What will be the proper way to invoke "foo" variable inside function2()?
For example, this works, but I understand that this is bad practise:
For example, this works, but I understand that this is bad practise:
Code: Select all
function1() {
foo := "Hello, John!"
}
function2() {
function1()
if foo = Hello, John!
msgBox, Hello Mike!
}
global foo
function2()