Errors, bugs, questions - page 2877

 
fxsaber:
How do I know in ME which function/method the cursor is now inside?

I also sometimes scroll up / down the code, then look for where I edited and the cursor is located

If I edited, I use Ctrl + Z (roll back the changes) ME goes to the cursor and immediately Ctrl + Y (roll back the changes)

 
Igor Makanu:

I also sometimes scroll up / down the code, then look for where I edited and the cursor is located

If I've edited, I use Ctrl + Z (roll back the changes) ME goes to the cursor and immediately Ctrl + Y (roll back the changes)

Similarly! Also ALT + LEFT/RIGHT. But you still need to get the function name. Or go to its definition.

 
What is the difference between these flags?
FileSelectDialog(NULL, NULL, NULL, FSD_WRITE_FILE, FileNames, NULL);
FileSelectDialog(NULL, NULL, NULL, 0, FileNames, NULL);
 
The trouble with private messages again ...
 
Vladimir Pastushak:
The trouble with private messages again ...

In the search box, type the name of anyone who has written to you. Then everything will go back to normal. I just checked it today.

 
Chats are being upgraded, sorry for the temporary inconvenience
 
typedef datetime (*TIME)( void ); 

datetime Func() { return(0); }

TIME T = TimeCurrent;  // Error.
TIME T2 = Func;        // OK.


Has it always been the case that you can't make pointers to staff functions?

 
Is it right that there is no error?
void OnStart()
{
  for (int i = 0; i < 5; i++) // OK
}
 
fxsaber:

Was it always the case that you couldn't make pointers to staff functions?

Yes, it's always been impossible.

fxsaber:
Is it correct that there is no error?

This is an oversight at least because the following entries are equivalent

void f1() { for  (; false ;) } //нормально ???
void f2() { while(  false  ) } //Error: '}' - semicolon expected

Correspondingly, the compiler's behavior must be identical, which is different

 

you need to get 1 uint from 2 ushort

there are 2 options(yellow / green):

input ushort inA = USHORT_MAX;
input ushort inB = USHORT_MAX;
input ushort inC = USHORT_MAX;
input ushort inD = USHORT_MAX;
uint param1 = (uint)inA << (sizeof(ushort) * 8) | inB;
uint param2 = (uint)inC << (sizeof(ushort) * 8) | inD;
union ushortTouint
{
   uint param[2];
   ushort in[4];
};
ushortTouint param_arr;
//+------------------------------------------------------------------+
void OnStart()
{
   printf("ver 1:  %X , %X", param1, param2);
   param_arr.in[0] = inA;
   param_arr.in[1] = inB;
   param_arr.in[2] = inC;
   param_arr.in[3] = inD;
   printf("ver 2:  %X , %X", param_arr.param[0], param_arr.param[1]);
}
//+------------------------------------------------------------------+

how would you know which conversion variant would work faster in optimisation (I will use 10 uint and respectively 20 ushort)

Reason: