12345678910111213141516171819202122232425262728 |
- <div class="w3-item"><img src="img/icn_variaveis.png" title="icone creation of global variable" class="w3-icon icon_32x32" />
- <h3>Global Variable</h3>
- <p>
- The <i>variables</i> are used to store values.
- In the case of <i>global variable< i>, it is the whole <i>variable</i> created in the external area of the main program (see image).
- This type of variable is <b>recognized</b> at any point in your code, that is,
- within any function, you can use this <i>variable as long as<b> no </b>there is no local variable of the same name</i>!
- <bf/>
- It is recommended that <b>avoid using this type of variable </b>, as this can lead to confusion in the code.
- <bf/>
- <center>
- <div style="width: 500px;margin-top:5px"> <img src="img/var_global.png" title="image global variable interface"></div>
- </center>
- </p>
- <p>
- When you create a global variable, you can configure the following characteristics:
- <ol>
- <li><b>Const:</b> although it has the variable name, when we define a variable to be constant, it <b>can not</b> have its initial value changed;</li>
- <li><b>Type:</b> defines the type of information that will be stored in the variable (simple types: integer, real, string or logical, vector: any simple type);</li>
- <li><b>Name:</b> defines the name of the variable, used to trigger it from any part of the program;</li>
- <li><b>Value:</b> defines a value to be stored in the variable.</li>
- </ol>
- </p>
- </div>
|