remove all declared variables

remove all declared variables - is there any function to remove all declared variables? similar to clear - Сообщения

#1 Опубликовано: 29.09.2021 23:59:19
JOSEPH7

JOSEPH7

0 сообщений из 1 понравились пользователям.

Группа: User

Help!

is there any function to remove all declared variables? similar to clear
#2 Опубликовано: 01.10.2021 18:45:30
Oscar Campo

Oscar Campo

124 сообщений из 298 понравились пользователям.

Группа: Moderator

Wrote

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 пользователям понравился этот пост
Andrey Ivashov 01.10.2021 18:49:00
#3 Опубликовано: 01.10.2021 18:51:47
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3729 понравились пользователям.

Группа: Super Administrator

Wrote

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
1 пользователям понравился этот пост
Oscar Campo 02.10.2021 02:58:00
#4 Опубликовано: 02.10.2021 11:36:43
overlord

overlord

549 сообщений из 1332 понравились пользователям.

Группа: Moderator

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
#5 Опубликовано: 16.10.2021 15:08:40
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Wrote

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.

Imagen1.png

Best regards
Alvaro.
#6 Опубликовано: 17.10.2021 07:41:24
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 (15 КиБ) скачан 47 раз(а).
#7 Опубликовано: 17.10.2021 12:27:54
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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.
#8 Опубликовано: 17.10.2021 14:29:26
overlord

overlord

549 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

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
#9 Опубликовано: 27.05.2023 16:25:38
OlliL

OlliL

0 сообщений из 3 понравились пользователям.

Группа: User

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.
#10 Опубликовано: 27.05.2023 21:17:00
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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.

#11 Опубликовано: 28.05.2023 09:12:56
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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(,,,)=
#12 Опубликовано: 06.06.2023 02:06:54
OlliL

OlliL

0 сообщений из 3 понравились пользователям.

Группа: User

Wrote

Wrote

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?
#13 Опубликовано: 06.06.2023 11:27:27
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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 (9 КиБ) скачан 37 раз(а).

#14 Опубликовано: 06.10.2023 03:50:47
rkronhofer

rkronhofer

0 сообщений из 1 понравились пользователям.

Группа: User

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
#15 Опубликовано: 06.10.2023 13:31:53
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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.
#16 Опубликовано: 08.10.2023 13:55:30
overlord

overlord

549 сообщений из 1332 понравились пользователям.

Группа: Moderator

Wrote

So there is a Clear(All) function?


There is not a Clear(All) function.
No method is applicable to remove all variables at once.

Wrote

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
#17 Опубликовано: 09.10.2023 06:45:04
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

CustomFunctions plugin

ClearAll.png

direct link: link removed (now the extensions manager works again)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
3 пользователям понравился этот пост
Oscar Campo 09.10.2023 07:38:00, Arie 09.10.2023 10:58:00, overlord 09.10.2023 18:20:00
#18 Опубликовано: 09.10.2023 18:23:22
overlord

overlord

549 сообщений из 1332 понравились пользователям.

Группа: Moderator

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 пользователям понравился этот пост
Oscar Campo 09.10.2023 20:25:00
#19 Опубликовано: 10.10.2023 11:54:52
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

Wrote

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).

Wrote

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.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#20 Опубликовано: 11.10.2023 15:49:18
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

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.

  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений