Group Abstract Group Abstract

Message Boards Message Boards

Clearing symbols on the fly

POSTED BY: Carlos Felippa
2 Replies

Hi Sander,

Thanks! That solves my problem.

POSTED BY: Carlos Felippa

Hi Carlos,

Clear and ClearAll both have attributes HoldAll (Attributes[Clear]), meaning that it does not evaluate it's arguments. So it tries to clear "w"<>ToString[1] as a whole. You have to explicitly evaluate it before executing the function like:

w1=3
Clear[Evaluate["w"<>ToString[1]]]
w1

Hope that helps.

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard