You can have them as global and assign them but you should not redeclare them in the function once again or else you will have the problem of the variable get assigned to the local one. Try seeing my both the function FuncLocal and FuncGlobal where I don't have variables declared in one of them and the behavior is as expected.