Bug with GlobalVariableSetOnCondition() ?

 
The definition of GlobalVariableSetOnCondition() says :
<< If there is no global variable, the function will generate error ERR_GLOBAL_VARIABLE_NOT_FOUND (4058) and return FALSE >>

But if you execute :
Print( "GlobalVariableSetOnCondition( \"GV_TEST\", 1.0, 2.0 ) returns ",GlobalVariableSetOnCondition( "GV_TEST", 1.0, 2.0 )," and GetLastError() is << ",ErrorDescription( GetLastError() )," >>" );



the result is :

GlobalVariableSetOnCondition( "GV_TEST", 1.0, 2.0 ) returns 0 and GetLastError() is << no error >>



There is no 4058 error generated.

 
I have some new ideas about this problem. It seems to come from GlobalVariablesDeleteAll().
If you call this function just before GlobalVariableSetOnCondition(), the problem occurs.


This is the test (it's a SCRIPT, not an indicator)
//+------------------------------------------------------------------+
//|                                                  TEST_SCRIPT.mq4
//|                                                             
//|                                                                 
//| A test script to show a problem with the following commands : 
//|    - GlobalVariableSetOnCondition(...)                         
//|                                                                
//+------------------------------------------------------------------+
#include <stderror.mqh>
#include <stdlib.mqh>


int start()
{

   // We delete all global variables to begin from scratch
   GlobalVariablesDeleteAll();

   /*
    *  The definition of GlobalVariableSetOnCondition() says ;
    *  << If there is no global variable, the function will generate 
    * error ERR_GLOBAL_VARIABLE_NOT_FOUND (4058) and return FALSE >>
    */
   Print( "GlobalVariableSetOnCondition( \"GV_TEST\", 1.0, 2.0 ) returns ",
          GlobalVariableSetOnCondition( "GV_TEST", 1.0, 2.0 ),
          " and GetLastError() is << ",ErrorDescription( GetLastError() )," >>" );
   
   return(0);
}