November 15, 201015 yr Hi. During the course of the scripts throughout a session, I have quite a number of variables set to parse values between tables etc. Being the kind of programmer I am, I prefer to clean up after myself and remove and non-essential debris. Although variables wouldnt consume much RAM (especially given how much RAM computers have these days), but is there any way (or need to) remove a variable once it's job is done? Simple housekeeping really. Cheers, Greg
November 15, 201015 yr Script variables - i.e. variables prefixed by a single $ and declared during script runtime - are automatically cleared when the script terminates.
November 16, 201015 yr Author Hi Comment, Thanks for your response. No only was I not clear, but realised what my question really came down to. I meant to be discussing global variables - I failed to mention that. I would pass them between different modules in different scripts so would need to be global to do the job. Is there anyway to clear global variables? Not just empty the contents, but remove them from memory? Cheers, Greg
November 16, 201015 yr Any variable that is set to empty ceases to exist. However, the purpose of global variables is to persist - perhaps you should consider script parameter and script result for exchanging values between scripts.
Create an account or sign in to comment