Code: Select all
$var3 = test
macro test {
$var = test
$var2 = test2
log $var
}
macro test2 {
log $var2
}
macro test3 {
log $var3
}
1. If I call the macro "test" it will work.
2. If I call the macro "test2" after I call the macro "test" it will work.
3. If I call the macro "test2" before I call the macro "test" it will return a null value.
4. If I call the macro "test3" it will return a null value.
So my problem now is what is the best way to use global variable? I'am making a macro that will used value from a config file and it will be a hustle if I call @cofig every time I need this value. So what is the correct way to use global variable in macro? thanks