Does "clear" command clears the global variables
17 views (last 30 days)
Does clear command clears all the variables in the workspace including global variables. In my code, there are lots of global variables. On running the code multiple times it seems that previous global variables are not getting cleared.
I'm using below command at the start of the Code
Adam on 27 Jun 2017
Edited: Adam on 27 Jun 2017
gives a very clear description of the various arguments to clear and what gets cleared by each instruction.
'removes all variables from the current workspace, releasing them from system memory.' to quote that documentation verbatim.
So as ever with global variables it is a murky mess depending whether they are in your workspace or not. If not then they won't be cleared.
Moral of the story is to simply not use globals and to read the documentation!!