快速登录:  

Forum: General Discussion

话题: VDJScript - Actions vs queries and is deck playing?

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

doug9474ControlleristMember since 2019
I read in the wiki : Commands can be used either as actions or as queries, depending on the context.

How can I tell if a command is an action or a query? It gave examples, but didn't really specify a concrete rule.

Secondly, if I want to write a conditional operator that runs a different command based on if the deck is playing or not, how would I do that?

Thanks,
Doug
 

发表时间 Sun 25 Aug 19 @ 8:56 am
NicotuxHome userMember since 2014
Some commands can be used as queries not all
Some action only verbs exist
Some query only verbs exist

Badly no full list of existing verbs and usage or description exist yet

The context is simple : it's a query when used in a way to get its status/value
- left side of the nested conditional operator "?"
- as a parameter to another command
- in "query" field in skin
- in button names
It is an action when it will execute

play ? stop : play
1st play is a query, stop and second play are actions

set 'my_var' "`play`"
set is the action
play is a query

A good startpoint is Locodog's Script School : https://www.virtualdj.com/forums/223743/General_Discussion/Script_School.html?page=1
 

发表时间 Sun 25 Aug 19 @ 3:03 pm
doug9474ControlleristMember since 2019
Usually programming language definitions are very formal and precise and I'm sure a formal definition exists (it has to), although maybe no one has typed it out yet. It would be great if someone published a formal definition.

Thanks for that info though! It is helpful.

Thanks,
Doug
 

发表时间 Mon 26 Aug 19 @ 3:35 am
doug9474ControlleristMember since 2019
set 'my_var' "`play`"

wow.. three different types of quotes. yup, I'm definitely going to have to study more lol
 

发表时间 Mon 26 Aug 19 @ 4:27 am
NicotuxHome userMember since 2014
LoL
My bad,
in practice the simple and double are the same
I simply use to quote variables and doublequote the other

with simple name and simple script they are optional

set my_var `play`

does exactly the same
 

发表时间 Tue 27 Aug 19 @ 12:29 am


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