remove all declared variables

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

#21 Posted: 10/11/2023 4:06:47 PM
overlord

overlord

549 likes in 1332 posts.

Group: Moderator

Wrote

Usually I prefer a binary output, since can be used...


Fair point, I withdraw my proposal.

#22 Posted: 10/11/2023 7:50:26 PM
Oscar Campo

Oscar Campo

124 likes in 298 posts.

Group: Moderator

Wrote


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.



Maybe the options could be:

arg == 1 --> "All cleared"
arg == 0 --> "Variables cleared"
arg == -1 --> "Functions cleared"

So it can be used easily in if/else functions.

Oscar
#23 Posted: 10/12/2023 5:53:23 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wouldn't be easier to return the input number?

ClearAll(1) == 1 --> "All cleared"
ClearAll(2) == 2 --> "Variables cleared"
ClearAll(3) == 3 --> "Functions cleared"
ClearAll(x) == 0 --> "nothing done"
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Oscar Campo 10/12/2023 7:33:00 AM
#24 Posted: 10/12/2023 8:33:54 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

algo style ... nothing to Clear(,) in there.

Stat Hypergeometric NATIVE.sm (26 KiB) downloaded 26 time(s).
#25 Posted: 10/12/2023 10:42:18 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

In terms of readibility I'd prefer

ClearAll()
ClearVars()
ClearFunctions()

each returning 1 or 0.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
3 users liked this post
Oscar Campo 10/12/2023 11:31:00 PM, ioan92 10/12/2023 2:17:00 PM, sergio 10/13/2023 8:41:00 PM
#26 Posted: 11/2/2023 12:08:07 AM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

In terms of readibility I'd prefer

ClearAll()
ClearVars()
ClearFunctions()

each returning 1 or 0.



updated

  • added ClearAllFunctions(1);
  • added ClearAllVariables(1);
  • removed options from ClearAll(1).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
2 users liked this post
Alvaro Diaz Falconi 11/2/2023 12:23:00 AM, Martin Kraska 11/2/2023 4:36:00 AM
#27 Posted: 11/2/2023 4:38:51 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Can't find the update in the online gallery.

A suggested extension for Clear(): could you allow for any expression and clear all variables and functions in it (all user defined ones). In particular, a list or a matrix of variable names would be convenient.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#28 Posted: 11/2/2023 4:34:30 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

Wrote

Can't find the update in the online gallery.



I know, the release manager it's not working as expected currently; that's why I've added a direct link (the zip containing the plugin must be downloaded and dragged into the canvas).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Oscar Campo 11/2/2023 4:37:00 PM
#29 Posted: 11/3/2023 7:05:04 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

updated (if the extensions gallery doesn't works, download the zip and drag&drop it into the canvas)

  • added ListFunctions(1);
  • added ListVariables(1);
  • fixed preprocessing in Zeros() and Ones().
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
sergio 11/3/2023 11:27:00 PM
#30 Posted: 12/10/2023 5:15:39 AM
Eduardo Palma Zambrano

Eduardo Palma Zambrano

0 likes in 7 posts.

Group: User

Wrote

CustomFunctions plugin

ClearAll.png

direct link: (removed)



Gracias
  • New Posts New Posts
  • No New Posts No New Posts