confusion about the behaviour of the variables - page 3

 
valenok2003:


Vlad, there is an error here, initialisation happens every time you change external parameters. And that's exactly what it's about, if it's about the inite.

dear valenki.

It's not about the internet.

read the last post with an example

 
wlad:

here is a similar example

the value of the first variable is passed to the second variable only once and the value of the second variable should not change at further execution of the program

but every time the first variable is changed, the value of the second variable changes, which should not be the case

extern string Value = "O";
       
string temp_="";
bool   firsttime=true;
       
int start() {
   string txt=StringConcatenate( "  Value: ",Value,"\n",
                                 "  temp_: ",temp_,"\n",
                                 "  firsttime: ",firsttime);    
   if(firsttime) { temp_=Value; firsttime=false; } // значение присваевается тольо ОДИН раз   

   Print(txt);
   Comment(txt);                              
}

the first variable is Value or temp_? how do you change it? You change the value of Value in the net, right?

then you press OK, and

the variables are reset to their original values as you described them.

string temp_=""; 
bool   firsttime=true;

every time you change Value via set , this procedure is repeated

 

try changing the Value programmatically

extern string Value = "O";
       
string temp_="";
bool   firsttime=true;
int Cnt = 0;
       
int start() {
   
   Value  = "O "+Cnt; 
   Cnt++;
   string txt=StringConcatenate( "  Value: ",Value,"\n",
                                 "  temp_: ",temp_,"\n",
                                 "  firsttime: ",firsttime);    
   if(firsttime) { temp_=Value; firsttime=false; } // значение присваевается тольо ОДИН раз   
   Print(txt);
   

and you will see that temp_ and firsttime will change once and will not changeagain

 
valenok2003:

try changing the Value programmatically

and you will see that temp_ and firsttime will change once and never changeagain

explicitly

I was only talking about changing an external variable.

 
valenok2003:

the first variable is Value or temp_? how do you change it? You change the value of Value in the net, right?

Then you press OK, and

and the variables are reset to their original values as you described them.

Every time you change the value with set , this procedure is repeated.


Yes, not the original, but with an external variable extern string

you don't want to read carefully

I've already written it many times

the problem occurs only with variables of type string with other types no problems!


 
valenok2003:

the first variable is Value or temp_? how do you change it? You change the value of Value in the net, right?

Then you press OK, and

and the variables are reset to their original values as you described them.

every time you change the value via set , this procedure is repeated.

Where did you get this false information?

you'd better check and see for yourself that it's wrong

It's all covered in the help.

I gave you an example

and you're making up things that aren't there.

 
in general, I would like the developers to pay attention to
 
wlad:
in general, I would like the developers to pay attention to

Maybe we should switch nicknames? Or is this just a practical joke?
 

test it yourself.

and you'll see what it's all about

 
wlad:
in general, I would like the developers to pay attention to

What do the developers have to do with it? Do you want them to store your variable on their server? While your computer hangs and reboots because of a power outage?
Reason: