Rank: Newbie
Groups: Registered
Joined: 21/11/2020(UTC) Posts: 1 Location: AREQUIPA 04000
|
Help! is there any function to remove all declared variables? similar to clear
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 10/12/2009(UTC) Posts: 238 Location: Cali, Colombia Was thanked: 79 time(s) in 60 post(s)
|
Originally Posted by: JOSEPH7 Help! is there any function to remove all declared variables? similar to clear You can install the "Special Functions" plugin, which has a Clear() function as you need.
|
1 user thanked oscampo for this useful post.
|
|
|
Rank: Administration Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member Joined: 11/07/2008(UTC) Posts: 1,616 Was thanked: 1978 time(s) in 666 post(s)
|
Originally Posted by: oscampo You can install the "Special Functions" plugin, which has a Clear() function as you need. Actually this plug-in is built-in into the installer package.
|
1 user thanked Andrey Ivashov for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,125 Was thanked: 506 time(s) in 337 post(s)
|
If SMath would allow to clear variables inside a matrix, that would be an answer for your request. But it does not, so this is a dead-end. For now, you have to make all your variables an element of vector/matrix, if you want to clear all of them in single command. Or manually clear them one by one. Regards Edited by user 02 October 2021 18:42:59(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 28/08/2014(UTC) Posts: 1,356 Was thanked: 815 time(s) in 516 post(s)
|
Originally Posted by: JOSEPH7 Help! is there any function to remove all declared variables? similar to clear Hi. I think what the user request is a function similar to "clear all" in Matlab. Given that include is capable of collecting all the names of the variables of a worksheet as the "whos" command of Matlab would do, perhaps the include code can be used to implement the option to delete all the variables with Clear( "all" ) or something similar. Best regards Alvaro.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
Originally Posted by: JOSEPH7 is there any function to remove all declared variables? similar to Clear Clear(■,■,■,■,■) ... clears the system in cause [variables, vectors, matrices] Clear(x,y,z,m,ω)=1 are evaporated from the system. Page17 Clear.sm (16kb) downloaded 25 time(s).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
Originally Posted by: JOSEPH7 is there any function to remove all declared variables? similar to clear remove ... you mean clear for reuse ? Option Find [Ctrl+F] finds numerical single value, it takes only one search at time, greek not from palette but copied from palette Does not distinguish math regions from text. Not much use for Find. If the letter is a vector just ignored.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,125 Was thanked: 506 time(s) in 337 post(s)
|
Originally Posted by: Razonar Hi. I think what the user request is a function similar to "clear all" in Matlab. Yes Razonar, probably that is the OP's request. He doesn't want to write every variable into Clear(). Just Clear(ALL) and puff, all defined shall be cleared. Regards
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 13/02/2023(UTC) Posts: 3
|
Hi, sorry to resurrect the thread, just chiming in to say that I would really love a Clear(ALL) function too. Often it would be nice to use a one SMath file to make multiple repeat calculations but not being able to clear the variables makes repeat calculations extremely risky.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
Originally Posted by: JOSEPH7 is there any function to remove all declared variables? similar to clear The Clear(All) will not clear matrix/vector that are not resident (isolated). Fromm observation, in that case, set XY the matrix XY:=0 That clears the global system calculation.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
Originally Posted by: JOSEPH7 is there any function to remove all declared variables? similar to Clear Not all variables/parameters are declared. Many reside @ the kernel level, not recognized by Clear(,,,)= I have an instance that can't be renewed by Clear(,,,)=
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 13/02/2023(UTC) Posts: 3
|
Originally Posted by: Jean Giraud Originally Posted by: JOSEPH7 is there any function to remove all declared variables? similar to Clear Not all variables/parameters are declared. Many reside @ the kernel level, not recognized by Clear(,,,)= I have an instance that can't be renewed by Clear(,,,)= Good morning! So there is a Clear(All) function? How is it used?
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
Originally Posted by: OlliL So there is a Clear(All) function ? How is it used ? AFAIK, there is no Clear(All) ... what is All ?Clear(,,,) also restores the built-in. Cheers ... Jean. Maths Clear Restore.sm (10kb) downloaded 15 time(s).
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 11/07/2023(UTC) Posts: 1 Location: Austria
|
Hy, is there any update on such a "Clear(All)" function? Would be really helpful to have it like this a:=5 b:=6 Clear(All):=1 a=? b=? Thanks for answers BG
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
Originally Posted by: OlliL Often it would be nice to use a one SMath file to make multiple repeat calculations but not being able to clear the variables makes repeat calculations extremely risky. Build your system algo style complete wrt parameters Collapse in utilities, top document. Now, you are in-situ command line mode ... Nothing to clear. Just plug parameters in each command line.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,125 Was thanked: 506 time(s) in 337 post(s)
|
Originally Posted by: OlliL So there is a Clear(All) function? There is not a Clear(All) function. No method is applicable to remove all variables at once. Originally Posted by: rkronhofer is there any update on such a "Clear(All)" function? There is not an update, yet. Unfortunately, I guess none shall appear on horizon soon. Regards
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,639 Location: Italy Was thanked: 1323 time(s) in 873 post(s)
|
|
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
3 users thanked Davide Carpi for this useful post.
|
on 09/10/2023(UTC), on 09/10/2023(UTC), on 10/10/2023(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,125 Was thanked: 506 time(s) in 337 post(s)
|
This works!!! Thanks for the beta update.
What would you think about revising output string? Instead of "1", it can be; arg==1 --> "All cleared" arg==2 --> "Variables cleared" arg==3 --> "Functions cleared"
Regards
|
1 user thanked overlord for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,639 Location: Italy Was thanked: 1323 time(s) in 873 post(s)
|
Originally Posted by: overlord This works!!! Thanks for the beta update. You're welcome, glad it seems to work correctly on first try. I still have to check carefully the (2)nd option, since as it is now it deletes "anything that is not a function" (including some low-level stuff). Originally Posted by: overlord What would you think about revising output string? Instead of "1", it can be; arg==1 --> "All cleared" arg==2 --> "Variables cleared" arg==3 --> "Functions cleared" Usually I prefer a binary output, since can be used inside if/else functions independently from localizations, future enhancements of descriptions, and string comparision issues. I'll think about it. Edited by user 10 October 2023 17:57:01(UTC)
| Reason: Not specified |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
Originally Posted by: JOSEPH7 is there any function to remove all declared variables? similar to clear If you have discretized [x,y,z ...] in part 1 of project as that part 1 is complete ... Clear(x,y,z) for next part of the project. Assume part 1 & part 2 are constructed around 5 parameters. If you ClearAll(,,,,,) past part 1 You have to re-install those 5 parameters that over-ride themselves from the new ones.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.