ZBrushCentral

Question: Is there function like as "Switch & Case"?

I would like to use Switch and case syntax, like as Javascript.
(for clear source code visibility)

switch (expr) {
  case 'One':
    Value=1;
    break;
  case 'Two':
    Value=2;
    break;
  default:
    Value="0";
}

Is there Switch syntax in Zscript?
Or, I have a only way to write the nest of [IF]?

Yes you have to chain [IF].
Switch does not exists in Zscript (see command reference ). It’s not an evolved language with all the control structures of C,C++ or Js .

1 Like

Thank you for answering :smiley:

1 Like

memo. I found.

This is a bit similar syntax to Switch and Case.
Maybe, a small source will have a bit more clear visibility than deep [IF] nest?:laughing:

1 Like

There is a switch…case construct that allows you to easily and conveniently manage multiple conditions and select the appropriate actions depending on the value of the variable. I’ve also recently ventured into new territory. I studied how we build custom applicant tracking system recruiting needs, found https://ddi-dev.com/blog/case/how-we-build-custom-applicant-tracking-system-recruiting-needs/ for this. I can imagine how difficult it was to create. It’s just unrealistically a lot of effort spent on this. But the system is very cool.