Inside any function we can access the variables defined inside this function beside the global variables.

Example:

# the program will print numbers from 10 to 1load"stdlib.ring"x=10# x is a global variable.funcmain{fort=1to10{# t is a local variablemycounter()# call function}}funcmycounter{print("#{x}\n")# print the global variable valuex--# decrement}

Note

Using the main function before the for loop declare the t variable as a local variable,
It’s recommended to use the main functions instead of typing the instructions directly to set the scope
of the new variables to local.