Trigonometry and Cases

I'm working on a project and I created these switch-case blocks, and advanced trigonomic functions. 5 blocks! What do you think?
PROJECT LINK HERE

Please post an image of the blocks with an explanation what they do, and for instance some examples. This way it is easier to see how they work.

switch case block

the switch block has many cases.
cases are basically procedures that happen if the value is the same as the main variable
{ switch (main) run [ case (value) run {code} ... ] }
basically this
Cases And Trigs script pic
is the same as this

switch default block

same as the switch block, but with a 'default'
if all of the cases are false and cant run, the default will run.
{ switch (main) default {default} [ case (value) run {code} ... ] }
so this:
Cases And Trigs script pic (2)
is the same as this:

trigonomic block

replicates the basic trigonomic functions
( trig [function v] of (x) )
sine cosine tangent cotangent sectant cosectant

hyperbolic block

replicates the hyperbolic trigonomic functions
( hyper [function v] of (x) )

Could you add a "$nl" to the end of the group labels? It puts all the cases on different lines and looks neater

ill do that now. the project is unfinished so im open to suggestions :slight_smile:

edit: i couldnt do it properly. 3 problems with this

first problem

i put it in as a seperator, but now, the expand text 'case, run' is completely gone.

second problem

i was hoping for it to be like this [value slot, case slot, newline] repeating
but unstead i got this [value slot, newline, case slot, newline]

third problem

i wanted the slots to be under the part of the title before the case slot 'switch () run'
but its to the right and doesnt look neat
i tried putting $nl before the slot itself
but now if the slot is empty the add and remove slot button goes under and also doesnt look good

im trying to fix this :frowning:

Yeah, SEPARATOR and EXPAND are kind of mutually exclusive and result in some weird things when used together. Adding the $nl to the EXPAND part is your best bet.

This is because you used SEPARATOR instead of EXPAND. However, you cannot have a newline and separator text together, so you would have to do something like this (losing the case label):

This third problem doesn't technically have a solution per se. However, in this particular case, why does your block need to be able to be collapsed all the way down? You can set the minimum and initial numbers of slots to 2:
Cases And Trigs script pic (1)

thanks!