Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 633

 
barabashkakvn:
To avoid problems with MetaTrader4/MetaEditor4, set "Run as Administrator" in terminal and editor file settings. After that the MQL4.Cloud and templates in the terminal will start working correctly.


Thank you. Somehow I have not thought of that at first :) I will try to do it. But I've already noticed that the "Program Directory" is now moved to a normal path:

C:\Program Files (x86)\Имя терминала\

As before. Although the "Shared Data Folder" is still here:

C:\Users\hoz\AppData\Roaming\MetaQuotes\Terminal\Common
 
hoz:


Thanks. Somehow I didn't think of it right away :) I'll try. But, at this point, I will already notice that the "Program Directory" has moved directly to the normal path:

As before. The "Shared data folder" is still here, though:

um,from admin.... do you have to? people don't know how to firewall....

I wondered how to do this to restrict permissions...

basically got it - install it as "non-administrator"

Thanks !!!! )))

 
_new-rena:

hmm, from admin.... do you have to? people don't know how to defaerwall....

I was wondering how to do this to restrict the rights of the meta user...

basically got it - install it as "non-administrator"

Thanks !!!! )))


As soon as I switched to Windows 8.1 I had to invent this way :)
 

In the end, there was no file and there isn't. Here is the current code of the class:

// 1.1 Пишим Log-файл. ====================================================================================================================
CLogging::fWriteLog( string  fs_Txt,                           // Данные, которые требуется записать в log-файл
                      bool   fb_PrintPermission = true,        // Флаг печати комментариев
                      bool   fb_CommentPermission = true )     // Флаг показа комментариев на графике
{
   static datetime ldt_NewDayOpen = 0;
   static string   ls_FileName = "";
   datetime        ldt_CurrDayOpen = iTime( Symbol(), NULL, PERIOD_D1 );
   //---- Имя лог файла определяем один раз в сутки
   if ( ldt_NewDayOpen != ldt_CurrDayOpen )
   {
      // ls_FileName = StringConcatenate( WindowExpertName(), "_", Symbol(), "_", Period(), "-", Month(), "-", Day(), ".log" );
      ls_FileName = StringConcatenate( "T" );
      ldt_NewDayOpen = ldt_CurrDayOpen;
   }
   int handle = FileOpen( ls_FileName, FILE_READ|FILE_WRITE|FILE_CSV, "/t" );
   
   FileSeek( handle, 0, SEEK_END );
   FileWrite( handle, StringConcatenate(TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS), ": ", fs_Txt) );
   FileClose( handle );
   
//   fPrint( fs_Txt, fb_PrintPermission, fb_CommentPermission );
}

Calling it from the Expert Advisor. The class is working. The functionfPrint, which works at the bottom (prints to the screen what you need), I've commented out, because I'm testing exactly the creation and writing to the file. I limited the long file name to one "T".

There is no file. Here's the search returned:


 
hoz:

In the end, there was no file and there isn't. Here is the current code of the class:

Calling it from the Expert Advisor. The class is working. The functionfPrint, which works at the bottom (prints to the screen what you need), I've commented out, because I'm testing exactly the creation and writing to the file. I limited the long file name to one "T".

There is no file. Here's a search that came up:

                  

int handle=FileOpen(Symbol()+".csv",FILE_READ|FILE_WRITE|FILE_CSV);
if(handle>0)
{                  
FileSeek(handle,0,SEEK_END);
double BID=MarketInfo(Symbol(),MODE_BID);
FileWrite(handle,DoubleToString(BID,4));
}
FileClose(handle);

try this, (I don't like to understand other people's code)

And another thing, the market stands, ticks don't come, start() doesn't work. Put the code in init() and compile ... and you'll be happy ))) !

//Don't forget to transfer it to start() or whatever it is now...

 

How do you use the return operator to return STRUCTURES?

Can the user function return structures, or is this used elsewhere?

Can a structure contain operators, or is it just a set of variables?

And in general, how are they handled? (in Russian only, and without references to someone's programs a mile long, you can use simpler examples, such as c=a+b).

 
tara, I've read it. Three times:-)) I'm asking about the return operator. It seems that I was going to "offload" something there not to rewrite the same thing 5 times. Or is it possible to declare something public/protected there and not to bother me?
 

Here

https://docs.mql4.com/ru/basis/operators/return

it says:

"You can return simple types, simple structures, and pointers to objects . Any arrays, class objects, or variables of complex structure types cannot be returned using the return operator .

"
 

Does anyone have a piece of code for an example where elements of a string array are grouped in alphabetical order?

Thanks in advance.

Reason: