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