The difference between local variables and global variables

I tried to use function to calculate some variables, but found that I can't distinguish between local or global variables

like this

function T1() 
    a1 = 1;

a1 = 0 

print a1; 

the a1 still 0

and then

a2 = 0; 

function T2() 
     a2 = 1;

print a2 ;

the a2 will be 1 ,

what's the difference

See Local & Global Variables Document.

Thank alot , the is what i want !!

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.