PureBasic 101 - Scopes

Pubblicato il: 13 marzo 2020
sul canale di: Pure Programming
1,578
57

Learn the fundamentals of PureBasic. In this PureBasic 101 series, I cover the language, the IDE, the tools and some programming tips and techniques.

In this episode, I explain variable scope : default (Define), Global, Shared, Protected, Static and Threaded.

Default (0:00:23) : the default scope is accessible from the main code but neither from procedures nor modules
Global (0:01:50) : global variables are accessibles from everywhere except modules (when defined outside of them)
Shared (0:08:36) : shared variables are a way to use a non-global (default) variable defined in the main code in a procedure.
Protected (0:11:21) : protected variables are local to a procedure. They are not accessible from outside the procedure and they can have the same name as a global variable.
Static (0:13:58) : static variables are local procedure variables that keep their value between calls.

[ADVANCED]
Threaded (0:18:24) : threaded variables are local to each thread but act as global variables within the thread. They are stored in the TLS (Thread Local Storage)

The file for this episode is available at http://bit.ly/39IDRin

Download PureBasic at http://www.purebasic.com/pp

Support the channel with some Merchandising
EU : shop.spreadshirt.net/pure-programming
US : shop.spreadshirt.com/pure-programming


In questa pagina del sito puoi guardare il video online PureBasic 101 - Scopes della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Pure Programming 13 marzo 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,578 volte e gli è piaciuto 57 spettatori. Buona visione!