© Mansour Ayouni 2020
M. AyouniBeginning Ring Programminghttps://doi.org/10.1007/978-1-4842-5833-0_6

6. Juggling with Scopes

Mansour Ayouni1 
(1)
Kalidia Consulting, Sousse, Tunisia
 

When data flows inside your algorithm, it is hosted in variables. Those variables travel from one corner of your program to another depending on several factors: the program structure, the design of your logic flow, the calling and sending strategy, and so on. In other words, they depend on the scope they are living in, or moving in, if you prefer.

Scope defines the visibility of your variables in the eyes of the Ring runtime. Depending on their location in the code, they are considered to be global or local variables.

Sometimes you’ll have a conflict between two variables. ...

Get Beginning Ring Programming: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.