Errors, bugs, questions - page 2529

 
A100:

Question about permissible characters in identifiers. Example

The result:

Received a variable identifier with a space.

If we rewrite the example like this:

then we can formulate a contradiction: What is the difference between (1) and (2)?

Well from a C/C++ point of view there is an error in µl. Any number of spaces/comments can be inserted before/after operator ##, tokens will be split first and then the preprocessor will start, i.e. it won't even see these spaces, the standard hash_hash has an example:

#define  hash_hash # ## #
#define  mkstr(a) #  a
#define  in_between(a) mkstr(a)
#define  join(c, d) in_between(c hash_hash d)
char p[] = join(x, y);    // equivalent tochar p[] = "x ## y";
#define  MACRO( x )              x##:AAA

only tokens that together form a valid token can be used.

ZS: some people say that c/s++ is not an authority for them, why do they keep mentioning them, and anyway it's mcl, not ..., maybe they have a proper explanation?

 
Vict:

maybe they have the right explanation?

Usually they have one explanation: it was designed by wise developers )
 
When working with large source files, ME is very sluggish - two 30 megabyte files, even switching from one to the other causes sluggishness, especially if copying a large amount of code from one to the other. In general, editing such files causes you to work in slow motion - tiresome.
 
Aleksey Vyazmikin:
When working with large source files ME gets very sluggish - two 30 MB files, even switching from one to another causes sluggishness, especially if copying large amount of code from one to another. And in general, editing such files leads to working in slow motion - tiresome.

30MB of text is clearly not needed for the job. Trouble yourself once, then put this data into an incluid.

 
Andrey Khatimlianskii:

30MB of text is clearly not needed for the job. Torture it once, then put the data into an incluid.

The data is single-type and subject to constant editing; it forms the basis of EA modification.

 
Comments not relevant to this topic have been moved to "OOP, templates and macros in mql5, tips and tricks of the trade".
 
Aleksey Vyazmikin:
When working with large source files ME hangs a lot - two files of 30 MB, even switching from one to another causes hangs, especially when copying a large amount of code from one to another. And in general, editing such files leads to work in slow motion - tiresome.

I think all text editors will behave this way

you need to break up such a huge source code anyway, or rewrite part of it in a library

 

Please help with a small task. I need a script that calls LABEL, which will blink at a certain interval, and that's it. The frequency of blinking and specifying coordinates I will do myself, the main thing for me is the function itself.

I found an example, rewrote it for my needs, but it just doesn't work. It blinks as it pleases, then every second, then disappears for a few seconds. And I would like the script to be executed until you stop it, not a certain number of times.

for(int i=0; i<50; i++)
   {
      if(!ObjectCreate(0,"Blink",OBJ_LABEL,0,0,0))
   {
      Print("Not Create! Error - ",GetLastError());
   }
   ObjectSetInteger(0,"Blink",OBJPROP_XDISTANCE,50);
   ObjectSetInteger(0,"Blink",OBJPROP_YDISTANCE,50);
   ObjectSetInteger(0,"Blink",OBJPROP_CORNER,CORNER_RIGHT_UPPER);
   ObjectSetString(0,"Blink",OBJPROP_TEXT,"Test");
   ObjectSetString(0,"Blink",OBJPROP_FONT,"Arial");
   ObjectSetInteger(0,"Blink",OBJPROP_FONTSIZE,18);
   ObjectSetDouble(0,"Blink",OBJPROP_ANGLE,0);
   ObjectSetInteger(0,"Blink",OBJPROP_ANCHOR,ANCHOR_RIGHT_UPPER);
   ObjectSetInteger(0,"Blink",OBJPROP_COLOR,Red);
   ObjectSetInteger(0,"Blink",OBJPROP_BACK,false);
   ObjectSetInteger(0,"Blink",OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,"Blink",OBJPROP_SELECTED,false);
   ObjectSetInteger(0,"Blink",OBJPROP_HIDDEN,true);
   ObjectSetInteger(0,"Blink",OBJPROP_ZORDER,0);
   
   Sleep(200);
   
   ObjectDelete(0,"Blink");
   
   Sleep(200);
   }
 

Unlikely to be corrected, but a mistake in general:

#define  A world
#define  MAKESTR(L) #L

void OnStart() {
   Alert( MAKESTR(A) );
}

Alert: world

expected: Alert: A

 
Igor Makanu:

I think all text editors will behave this way

All the same, you need to try to break such a huge source code into parts, or rewrite part of the code in the library

EditPad Lite works great with gigabyte files, copying and editing - I really liked the utility. Which means it's realistic. I understand the initial load when opening, or if you don't work with a tab for a long time, but now even editing a file is very difficult.