Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


2 Pages12>
Options
Go to last post Go to first unread
Offline JOSEPH7  
#1 Posted : 30 September 2021 05:59:19(UTC)
JOSEPH7

Rank: Newbie

Groups: Registered
Joined: 21/11/2020(UTC)
Posts: 1
Peru
Location: AREQUIPA 04000

Help!Sad

is there any function to remove all declared variables? similar to clear

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline oscampo  
#2 Posted : 02 October 2021 00:45:30(UTC)
oscampo


Rank: Advanced Member

Groups: Registered
Joined: 10/12/2009(UTC)
Posts: 238
Man
Colombia
Location: Cali, Colombia

Was thanked: 79 time(s) in 60 post(s)
Originally Posted by: JOSEPH7 Go to Quoted Post
Help!Sad

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.

thanks 1 user thanked oscampo for this useful post.
on 02/10/2021(UTC)
Offline Andrey Ivashov  
#3 Posted : 02 October 2021 00:51:47(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Originally Posted by: oscampo Go to Quoted Post
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.

ClearFunc_1.png
thanks 1 user thanked Andrey Ivashov for this useful post.
on 02/10/2021(UTC)
Offline overlord  
#4 Posted : 02 October 2021 17:36:43(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

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.

2021-10-02_17-31.png

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.

2021-10-02_17-34.png

Regards

Edited by user 02 October 2021 18:42:59(UTC)  | Reason: Not specified

Offline Razonar  
#5 Posted : 16 October 2021 21:08:40(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: JOSEPH7 Go to Quoted Post
Help!Sad

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.

Imagen1.png

Best regards
Alvaro.
Offline Jean Giraud  
#6 Posted : 17 October 2021 13:41:24(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: JOSEPH7 Go to Quoted Post
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).
Offline Jean Giraud  
#7 Posted : 17 October 2021 18:27:54(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: JOSEPH7 Go to Quoted Post
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.
Offline overlord  
#8 Posted : 17 October 2021 20:29:26(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
Originally Posted by: Razonar Go to Quoted Post
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
Offline OlliL  
#9 Posted : 27 May 2023 22:25:38(UTC)
OlliL

Rank: Newbie

Groups: Registered
Joined: 13/02/2023(UTC)
Posts: 3
Finland

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.
Offline Jean Giraud  
#10 Posted : 28 May 2023 03:17:00(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: JOSEPH7 Go to Quoted Post
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.

Offline Jean Giraud  
#11 Posted : 28 May 2023 15:12:56(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: JOSEPH7 Go to Quoted Post
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(,,,)=
Offline OlliL  
#12 Posted : 06 June 2023 08:06:54(UTC)
OlliL

Rank: Newbie

Groups: Registered
Joined: 13/02/2023(UTC)
Posts: 3
Finland

Originally Posted by: Jean Giraud Go to Quoted Post
Originally Posted by: JOSEPH7 Go to Quoted Post
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?
Offline Jean Giraud  
#13 Posted : 06 June 2023 17:27:27(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: OlliL Go to Quoted Post
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).

Offline rkronhofer  
#14 Posted : 06 October 2023 09:50:47(UTC)
rkronhofer

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

SMath_ClearAll.png
Offline Jean Giraud  
#15 Posted : 06 October 2023 19:31:53(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: OlliL Go to Quoted Post
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.
Offline overlord  
#16 Posted : 08 October 2023 19:55:30(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

Was thanked: 506 time(s) in 337 post(s)
Originally Posted by: OlliL Go to Quoted Post
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 Go to Quoted Post
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
Offline Davide Carpi  
#17 Posted : 09 October 2023 12:45:04(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
CustomFunctions plugin Beta

ClearAll.png

direct link: https://smath.com/en-US/view/CustomFunctions/download/1.1.8682.22805

Edited by user 09 October 2023 12:55:14(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
thanks 3 users thanked Davide Carpi for this useful post.
on 09/10/2023(UTC),  on 09/10/2023(UTC),  on 10/10/2023(UTC)
Offline overlord  
#18 Posted : 10 October 2023 00:23:22(UTC)
overlord


Rank: Advanced Member

Groups: Registered
Joined: 23/07/2013(UTC)
Posts: 1,125
Turkey

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
thanks 1 user thanked overlord for this useful post.
on 10/10/2023(UTC)
Offline Davide Carpi  
#19 Posted : 10 October 2023 17:54:52(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: overlord Go to Quoted Post
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 Go to Quoted Post
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
Offline Jean Giraud  
#20 Posted : 11 October 2023 21:49:18(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: JOSEPH7 Go to Quoted Post
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.

Users browsing this topic
2 Pages12>
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.