CopyObjects

Miscellaneous
Uses files from the file systemIt writes information to fileIt plays sound alerts
0 Views
0 Downloads
0 Favorites
CopyObjects
ÿþ#property strict

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

int handle,TYP;

string imya,text,adres;

//+HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH+

void OnStart()

  {

   adres="GetSetObjects\\"+Symbol()+".txt";

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

   FileDelete(adres,FILE_COMMON);

   handle=FileOpen(adres,FILE_WRITE|FILE_COMMON);

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

   for(int obj=ObjectsTotal(); obj>=0; obj--)

     {

      imya=ObjectName(0,obj);

      if(StringLen(imya)<1){continue;}

      //+-----------------------------------------------------------------------------------------------+ V.LINE

      if(ObjectGetInteger(0,imya,OBJPROP_TYPE)==OBJ_VLINE)

        {

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

         FileWrite(handle,"TYP"+(string)ObjectGetInteger(0,imya,OBJPROP_TYPE));

         FileWrite(handle,imya);

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_WIDTH));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_STYLE));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIMEFRAMES));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_COLOR));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIME));

         continue;

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

        }

      //+-----------------------------------------------------------------------------------------------+ H.LINE

      if(ObjectGetInteger(0,imya,OBJPROP_TYPE)==OBJ_HLINE)

        {

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

         FileWrite(handle,"TYP"+(string)ObjectGetInteger(0,imya,OBJPROP_TYPE));

         FileWrite(handle,imya);

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_WIDTH));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_STYLE));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIMEFRAMES));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_COLOR));

         FileWrite(handle,ObjectGetDouble(0,imya,OBJPROP_PRICE));

         continue;

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

        }

      //+-----------------------------------------------------------------------------------------------+ T.LINE

      if(ObjectGetInteger(0,imya,OBJPROP_TYPE)==OBJ_TREND)

        {

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

         FileWrite(handle,"TYP"+(string)ObjectGetInteger(0,imya,OBJPROP_TYPE));

         FileWrite(handle,imya);

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_WIDTH));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_STYLE));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIMEFRAMES));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_COLOR));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_RAY));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIME1));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIME2));

         FileWrite(handle,ObjectGetDouble(0,imya,OBJPROP_PRICE1));

         FileWrite(handle,ObjectGetDouble(0,imya,OBJPROP_PRICE2));

         continue;

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

        }

      //+-----------------------------------------------------------------------------------------------+ F.LINE

      if(ObjectGetInteger(0,imya,OBJPROP_TYPE)==OBJ_FIBO)

        {

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

         FileWrite(handle,"TYP"+(string)ObjectGetInteger(0,imya,OBJPROP_TYPE));

         FileWrite(handle,imya);

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_WIDTH));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_LEVELWIDTH));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_STYLE));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_LEVELSTYLE));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIMEFRAMES));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_COLOR));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_LEVELCOLOR));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_RAY));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIME1));

         FileWrite(handle,ObjectGetInteger(0,imya,OBJPROP_TIME2));

         FileWrite(handle,ObjectGetDouble(0,imya,OBJPROP_PRICE1));

         FileWrite(handle,ObjectGetDouble(0,imya,OBJPROP_PRICE2));

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

         int levels=(int)ObjectGetInteger(0,imya,OBJPROP_LEVELS);

         FileWrite(handle,levels);

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

         for(int i=0; i<levels; i++)

           {

            FileWrite(handle,ObjectGetDouble(0,imya,OBJPROP_LEVELVALUE,i));

            FileWrite(handle,ObjectGetString(0,imya,OBJPROP_LEVELTEXT,i));

           }

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

        }

     }

   FileClose(handle); PlaySound("ok.wav");

  }

//+HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH+

Comments