Errors, bugs, questions - page 2537

 

If the ::Print() function outputs a long string (more than 260 characters) to the Toolbox/Experts window, it will be truncated to 256 characters by copying the string with the PCM/Copy function.


If, on the other hand, you copy it with PCM/Review/Copy, it is not truncated.

What's the difference?

 
A100:

I can see that.

#define  MACRO( ТОЛЬКО_НЕ_void )    Print( "OK" )
void OnStart() { MACRO(); }

Hmm, it's complicated...... Say hello to the EEJAMS!

#define    test(int) for(int i=0;i<10;i++) Print("OK");
//+------------------------------------------------------------------+
void OnStart()
  {
  test();
  }

'i' - undeclared identifier tst.mq5 16 3

The void version will work without any problems, but remember to take the foil off.
 
A100:

I can see that.

#define  MACRO Print( "OK" )
void OnStart() { MACRO; }

Do the brackets after the macro make you feel better?

And yes, using reserved words in macro parameter declaration is love to the preconditions of huge bugs. Well, everyone decides for himself how to shoot off his legs, good thing, the developers did not really secure us from this fascinating action, and they should be congratulated))))

Finally figure out what the parameter macro and how it is used.

 
Igor Makanu:

hmm, it's complicated for you...... Say hello to the Hedgehogs!

'i' - undeclared identifier tst.mq5 16 3

The void variant will work without problems, but you'll know better.
void OnStart()
  {
  for(i=0;i<10;i++) Print("OK");;
  }

This is what the preprocessor outputs to you.

PS two ; - this is not my typo, it will really be after the preprocessor.
 
Igor Makanu:

The void version will work without any problems, but you know best, don't forget to take off the foil.

In this particular case it will work, but not in the general case. No one needs the worst solutions for special cases. The void implies any keywords, in case you still haven't understood

 
Vladimir Simakov:

Do brackets after a macro make you feel better?

But yes, using reserved words in declaration of macro parameters is love to the preconditions of making huge bugs. Well, everyone decides for himself how to shoot off his legs, good thing, developers are not quite secured from this exciting action, for what they respect))))

Finally figure out what the parameter macro and how it is used.

I have an ironclad argument for you: "Everything works properly in C++". Do you have anything to reply to it? No? - Then keep your moral teachings to yourself. And you'd better figure it out - if you don't understand what brackets are for.

P. S. It wasIgor Makanuwho suggested it - write to him about it
 
A100:

In this particular case it will work, but not in the general case. Worst case solutions for special cases - nobody needs them. void meant any keywords, if you still don't understand

All right, go ahead, it's not pleasant to talk to you. I'm always attracted to personalities, I'm more interested in technical topics at this forum

Vladimir Simakov:

That's what the pre-processor outputted to you.

PS two ; - it's not my misprint, it really will be after the preprocessor.

I know what it's all about;

the question was purely technical - how to get it right

i used any type, i expected some bullshit - it worked out fine, i use it seldom (i mostly write the order sending as BUY(double lot) or simple BUY() macro) - I've always used void here - there were no problems and shouldn't be

 
A100:

I have an ironclad argument for you: "Everything works properly in C++". Do you have anything to contradict it?

And then there's C#, JS and all the rest. Only here is mql, and it has this.
 
Igor Makanu:

All right, keep busy, it's not pleasant to talk to you. You always have a tendency to jump to personalities, I am more interested in this forum on technical topics.

Not pleasant? Technical topics of interest? Judging by your message I understand you are more interested in the theme of S&M. I communicate with you - in your language - using your vocabulary

 
Vladimir Simakov:
And then there's C#, JS and all the others. Only here is mql, and it goes like this.

What does C#, JS and all the rest have to do with it? Read MQL documentation - page 1:

"The syntax of MQL5 is similar to that of C++".

https://www.mql5.com/ru/docs/basis.

Документация по MQL5: Основы языка
Документация по MQL5: Основы языка
  • www.mql5.com
Язык MetaQuotes Language 5 (MQL5) является объектно-ориентированным языком программирования высокого уровня и предназначен для написания автоматических торговых стратегий, пользовательских технических индикаторов для анализа разнообразных финансовых рынков. Он позволяет не только писать разнообразные экспертные системы, предназначенные для...
Reason: