快速登录:  

Forum: VirtualDJ Technical Support

话题: VDJ Script: if then without else

由于该帖子已年深日久,可能包含陈旧过时或描述错误的信息。

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.
 

发表时间 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
 

发表时间 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.
 

发表时间 Sat 04 Jan 20 @ 10:28 am


(陈旧帖子或论坛版块会自动关闭)