Here is a screen shot of the code that I am working with.
I am working with mBlock v5.4.3 and am using the mBot device and I am running the IDE on a Windows 11 PC.
As you can see, I am in live mode and am connected to the mBot.
Also note that I have a variable and block both called SomeName. After clicking on the green flag and then clicking on the variable SomeName you can see that the value of the variable is 40, This indicates that the value of the variable was initially set to 20 but was then changed to 40 after the block was executed. This code works even if the power switch on the mBot is turned off So far so good.
However, if I disconnect the mBot then the code will not run at all. Can I assume that in order to do something like displaying the value of the variable the IDE must have access to the controller even if the controller is turned off?
Now comes the real reason that I’m posting this topic.
If I now switch the mode over to Upload I am working with this code.
When I press the Upload Code button this is what I get.
It did not take long to see the source of the problem. However, some other users may not detect the source of the problem so quickly. I wonder why there was not a problem in live mode but there is a problem in Upload mode. Additionally, I think that it would be nice if there was a more user friendly way of letting the user know that they can not have a variable and a block with the same name.
I had a great experience working with Best_codes on a previous issue. I hope that he or she also takes a look at this.
Thanks in advance.