Author: Copyright © 2012, Nikolay Kositsin
0 Views
0 Downloads
0 Favorites
sendpush
ÿþ//+------------------------------------------------------------------+

//|                                                     SendPush.mq5 |

//|                           Copyright © 2012,     Nikolay Kositsin | 

//|                              Khabarovsk,   farria@mail.redcom.ru | 

//+------------------------------------------------------------------+  

#property copyright "Copyright © 2012, Nikolay Kositsin"

#property link "farria@mail.redcom.ru" 

#property description "Script to send PUSH-notification to smartphone."

//---- =><5@ 25@A88 A:@8?B0

#property version   "1.2" 

//---- ?>:07K20BL 2E>4=K5 ?0@0<5B@K

#property script_show_inputs

//+----------------------------------------------+

//| %+  " + ! "                    |

//+----------------------------------------------+

input string  PushText="Checking connection!";  //Text of PUSH-notification

//+----------------------------------------------+



//+------------------------------------------------------------------+ 

//| start function                                                   |

//+------------------------------------------------------------------+

void OnStart()

  {

//----

   if(!SendNotification(PushText))

     {

      Print("Failed to send PUSH-notification to smartphone!!!");



      switch(GetLastError())

        {

         case ERR_NOTIFICATION_SEND_FAILED       : Print("Failed to send notification!"); break;

         case ERR_NOTIFICATION_WRONG_PARAMETER   : Print("Invalid parameter of notification sending - empty string!"); break;

         case ERR_NOTIFICATION_WRONG_SETTINGS    : Print("Incorrect notification settings in the terminal (ID is not specified or the permission is not exhibited!)"); break;

         case ERR_NOTIFICATION_TOO_FREQUENT      : Print("Too often sending of notifications!"); break;

         default                                 : Print("Unknown error!");

        }



      ResetLastError();

     }

   else Print("PUSH-C254><;5=85 >B?@02;5=> =0 A<0@BD>=!!!");

//----

  }

//+------------------------------------------------------------------+

Comments