Advertisement
GustavoSLP

OnitVariavel

May 6th, 2024 (edited)
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. double variavelGobal1;
  2. double variavelGobal2;
  3.  
  4. //+------------------------------------------------------------------+
  5. //| Expert initialization function                                   |
  6. //+------------------------------------------------------------------+
  7. int OnInit()
  8.   {
  9.  
  10.     if (!InitializeAll())
  11.     {
  12.         Alert("Falha ao carregar variáveis globais!");
  13.         return INIT_FAILED;
  14.     }
  15.        
  16.  
  17. //--- done
  18.    return(INIT_SUCCEEDED);
  19.   }
  20.  
  21. bool InitializeAll()
  22. {  
  23.    bool return_value = true;  
  24.    variavelGobal1 = Input1;
  25.    variavelGobal2 = Input2;
  26.  
  27.             if(variavelGobal1 != Input1)
  28.               {
  29.                  return_value = false;
  30.               }
  31.  
  32.             if(variavelGobal2 != Input2)
  33.               {
  34.                  return_value = false;
  35.               }
  36.     return return_value;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement