Forum: Wishes and new features

Features you would like to see in VirtualDJ
话题: Don Moir's VDJScript editor / nested conditionals
Here, https://www.virtualdj.com/forums/223743/General_Discussion/Script_School.html?page=2

Don Moir created a page that appears to make the language much clearer to read. One thing that I have found very difficult to interpret without rewriting the code to make it more understandable is nested conditional statements. Even professional programmers such as myself find it difficult to read, so I know novices find it difficult... Don Moir's page broke down the parts of the conditionals into multiple lines and did color coding for the keywords.

A code editor such as this one should be a standard part of editing VDJScript. It takes too much time to read and rewrite nested conditionals when necessary. Unlike other languages, there aren't parenthesis, squigly braces or multiple lines.

Thanks,
Doug



发表时间 Mon 26 Aug 19 @ 5:01 am
NicotuxHome userMember since 2014
+1
but ...
Don Moir's tool page gives error 404 for weeks

You can now add lineefeeds in your scripts, free to you to format them

The other hand, complex scripts may use embedded scripts in strings or backquotes which are not easily formattable

Parenthesis is one of the most requested features for a looong time


发表时间 Tue 27 Aug 19 @ 12:19 am
Ok. Then, I request something like a function in 3G programming languages, where I could give a script a name and call it as necessary.

Also, could you point me to the documentation for embedded scripts? I'm not sure if they would do what I need, but I would like to know how to implement them.

发表时间 Mon 02 Sep 19 @ 8:30 pm
NicotuxHome userMember since 2014
What i "abusively" called "embedded scripts" are scripts called as parameters to verb.
These are simply strings with executable scripts in them such as the following example, not easy to format

holding ? set my_var 0 : set my_var "`var clock 12 ? get_clock 12 : var clock 24 ? get_clock 24 : play ? get_time 'remain' : loaded ? get_time 'total' : get_constant -1` "

If you want to implement some named "function" the actual "hack" is to create some unused custom buttons - i.e. custom_button 99 - or use dedicated custom pad page / pad ... and use them as needed as a subroutine
see custom_button, custom_button_name, get_custom_text, pad, padshift, padshift, pad_pressure, pad_color...

发表时间 Mon 02 Sep 19 @ 11:25 pm
ouch... kinda ugly and unwieldy...

but, I guess they can get the job done when necessary. something more like an IDE would be helpful, especially given how complex the language can be.

This is my interpretation of what's in the backticks for your script.


var clock 12 ?
get_clock 12
: var clock 24 ?
get_clock 24
: play ?
get_time 'remain'
: loaded ?
get_time 'total'
: get_constant -1

发表时间 Tue 03 Sep 19 @ 3:58 am
locodogPRO InfinityModeratorMember since 2013
How you're taking, it sounds like you're familiar with coding, vdj has an API, you'll still be talking to vdj with script but using C++ to write/ stringstream << the script is much easier.

发表时间 Tue 03 Sep 19 @ 7:31 pm
I am familiar with coding. I'll look into the C++ thing, but that sounds like even more trouble when I want to do something simple lol.

Hopefully someone will work on making vdjscript easier to use.

I have been thinking about a plugin idea though.... Maybe I'll work on that.



发表时间 4 days ago @ 11:29 am