confusion about the behaviour of the variables - page 5

 
There are problems with the lines, that's a fact. It's strange that nobody deals with them. Oh, no, it's not. It's only a month away from transition.
 

Thanks for the recognition MetaDriver and TheExpert, I am sick and tired of proving something wrong when others only read between the lines and give inappropriate comments.

I had hoped to correctly report the error here on the forum, but some feel obliged to give an answer without going into what it is about

 
wlad:

Here is an example to compare behaviour for strings and ints

and output to log:

1. loading EA and initiating global variables

2. transfer of external variables to global variables. one-time transfer implemented via bool firsttime

3. change of external variables

4. the difference can be seen here.

tempString takes the value of ValueString - wrong

tempInt keeps its value even though ValueInt has changed - correct

5 and 6 similar to 3 and 4


please explain why the string is behaving differently

while the Int is correct

please give me specific answers.


I think I understand what the problem is... If you manually changed parameters during testing in EA properties, they will be saved somewhere in .tpl files and even recompiling EA will not help. Only the "Reset" button will help. Whether it's a bug or not, I don't know...
 
It turns out that if you change something in the code, extern remains from the previous, previous version. And only resetting EA parameters helps. Is it a bug or not? .... once again I repeat..... do not know......
 
wlad:

Thanks for the recognition MetaDriver and TheExpert, I am sick and tired of proving something wrong when others only read between the lines and give inappropriate comments.

I had hoped to correctly report the error here on the forum, but some feel obliged to give an answer without going into what it is about


you should phrase questions correctly, you have not said anything about the problem with the tester
 

this is not the tester's problem!

1. the EA runs in normal operating mode on the graph, not in the tester!

I have not mentioned a word about the tester, do not know where you got that from!

2. External parameters change during run!

3. the problem emerges later with a global variable of the string type, which mistakenly takes the value

of an external variable when the latter changes.

 
wlad:

it's not the tester's problem!

1. the expert runs in normal operating mode on the graph, not in the tester!

i did not mention a word about the tester, i don't know where you got that from!

2. external parameters change during runtime

3. the problem occurs later with a global variable of the string type, which mistakenly takes a value

external variable when the latter is changed.


Curious. Couldyou please post the full code of TestInit2.
 

Damn, maybe I'm dumb.... But it's working correctly! ....Even with the log you've given me...

On the first tick tempString and tempInt are changed and then output to the log. Already from the second tick nothing is changed, it is just printed. Put prints and comments before the if. And you will see the difference.

 
valenok2003:

Curious. Couldyou please post the TestInit2 code in full.

all three examples given are fully posted

the code has been simplified to a minimum

 
Sepulca:

Damn, maybe I'm dumb.... But it's working correctly! ....Even with the log you've given me...

On the first tick tempString and tempInt are changed and then output to the log. Already from the second tick nothing changes, it is just printed. Put prints and comments before the if. And you will see the difference.

You really don't read everything.

I pointed out that the problem is obvious when you change external variables.

Read the example carefully.


the first examples with iniit printed only the bare necessities to locate the error, i just converted it to call

from start() because many people were confused by init()

Reason: