Trace task (constructing a function graph) - page 3

 
MetaDriver:

The trailer is a "conceptual work-in-progress", or rather an example of implementation.

Bad news: I didn't save the topicstarter's dream of a single trace function. Sorry Sergeyev. :)


Vladimir, thank you for your hard work... but... there's only one thing to do here. Otherwise the topicstarter won't let me go to sleep, and I'm already very eager :)
 
alsu:
And where does such a strange task come from? Is it worth expending effort on dubious research, when you can simply make two functions - input and output - and not bother?
Moreover, the problem is insoluble with a single function. You need peculiar brackets - input and output. Otherwise you get a nipple. :))
 
alsu:
And where did such a strange task come from? Is it worth spending effort on dubious research, if you can do two elementary functions - input and output - and not bother?

A task as a task. There are even stranger tasks on this forum.

You can't use it on the output... You have to work with every return + add { } brackets everywhere.

 
MetaDriver:
Not only that, the problem is insoluble with a single function. You need a kind of bracket - input and output. Otherwise you get a nipple... :))

Well, how about storing intermediate variables which will remember where they came from?
 
MetaDriver:

3. Two defines are written at the beginning of the program

cool!

had not even expected such use of #define - actually a precompiler directive, but by the book, as taught: #define abc 100 is used, and then I had no idea how widely you can use #define

special thanks!!!

 
IgorM:

awesome!

didn't even expect this use of #define - actually a precompiler directive, but by the book, as taught: #define abc 100 is used, and further I had no idea how widely #define can be used

special thanks!!!

well, it doesn't work in 4))
 
alsu:
well, that doesn't work in four, for example))

forbid me not to code on MT5 until people after the next build of MT5 will not stop complaining about new bugs and uncorrected old ones - wasting my time!
 
alsu:
Well, this, for example, does not work in 4))

:)

from mql4 documentation(MQL4 Reference - Language Fundamentals - Preprocessor - Declare a constant):

Using the #define construct, you can define a symbolic name or a symbolic constant at the beginning of the program, which will be a specific character string. Subsequently, the compiler will replace all unquoted occurrences of this name with the corresponding string. In fact, this name may be replaced by entirely arbitrary text, not necessarily numbers

But the fact that __FUNCTION__ macro is undefined (and there is no analog) in 4 is true. In fact this makes the task of code pre-parsing more tedious and less versatile.

 
sergeev:

Well, what about through storing intermediate variables that will remember where they came from?
Well, what if recursion is encountered in the program?
 
MetaDriver:
Well, what if recursion is encountered in the programme?

Recursion cannot cause a branch to lengthen (new and new nodes to appear).
At least - this can be foreseen right away. But usually recursions are not used so often that one does not know about them.

Reason: