June 24, 200817 yr In a script where multiple variable are used is there a way to clear them to nothing once the script is done. I'd love a way to clear all variables with about have to specify each and every one.
June 24, 200817 yr Local script variables (single $) don't need to be cleared. You could arrange your script to only use those. If you're calling subscripts, you'd need to pass those locals to other locals via a Script Parameter.
June 24, 200817 yr As DJ says, it's best to use local variables unless you have some reason to use globals. As Vaughan notes, you clear a variable the same way you clear a field: setting it to "". One nice technique to know is that you can set multiple variables in one step using a Let calculation like so: Set Variable( $clearMyVars ; Let( [ $$var1 = "" ; $$var2 = "" ; $$var3 = "" ] ; "voila" ) )
Create an account or sign in to comment