menu_var_variavel-global.html 1.4 KB

12345678910111213141516171819202122232425262728
  1. <div class="w3-item"><img src="img/icn_variaveis.png" title="icone creation of global variable" class="w3-icon icon_32x32" />
  2. <h3>Global Variable</h3>
  3. <p>
  4. The <i>variables</i> are used to store values.
  5. 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).
  6. This type of variable is <b>recognized</b> at any point in your code, that is,
  7. 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>!
  8. <bf/>
  9. It is recommended that <b>avoid using this type of variable </b>, as this can lead to confusion in the code.
  10. <bf/>
  11. <center>
  12. <div style="width: 500px;margin-top:5px"> <img src="img/var_global.png" title="image global variable interface"></div>
  13. </center>
  14. </p>
  15. <p>
  16. When you create a global variable, you can configure the following characteristics:
  17. <ol>
  18. <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>
  19. <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>
  20. <li><b>Name:</b> defines the name of the variable, used to trigger it from any part of the program;</li>
  21. <li><b>Value:</b> defines a value to be stored in the variable.</li>
  22. </ol>
  23. </p>
  24. </div>