and then changed it? why didn’t it work?
Also you assigned the variable outside the function at the beginning; so shouldn’t it already be global and thus not need ‘var global’?
1.) It worked. It was something else messing up. 2.) Yes you need to write the keyword global before the name of variable in a function if you want to update/change what it contains. Else it would create a local variable of that name if global isn't used (correct me if am wrong)
Обсуждают сегодня