Connexion rapide:  

Forum: VirtualDJ Technical Support

Sujet VDJ Script: if then without else

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

Hi,

I'm very new on VDJ and on VDJ script. - I'm trying to wirte a command for a button which should do something if the focus is on playlist an do nothing if the focus isn't on playlist. So I think that I simply need an if-then construct without the else-part but i couldn't find anything about this through this website.

May anyone can give me an advice? - Thanks! :)

By the way: is there an option to use brackets or something similiar? I want to get more clarity in my script.
 

Posté Fri 03 Jan 20 @ 5:49 pm
You just omit the else part.
e.g.:
play ? pause

You can also use nothing as an action where needed:
play ? pause : nothing
OR
play ? nothing : pause

PS: No, you can't use brackets

PS2: There's no "else if" or if this AND if that.
For such cases you need to nest multiple if's
loaded ? play ? pause : nothing : load
 

Posté Fri 03 Jan 20 @ 7:56 pm
Bofrost_Mann #23 wrote :
By the way: is there an option to use brackets or something similiar? I want to get more clarity in my script.
A bit over the top perhaps, but you could always write a post-processor script which could take a custom bracketed if-[else] block format and convert it into a ternary operator which VDJScript understand. You could even use this to chain several ternary checks.
 

Posté Sat 04 Jan 20 @ 10:28 am


(Les anciens sujets et forums sont automatiquement fermés)