Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: get_var text variable sets it to null ?
NicotuxHome userMember since 2014
"set '$V' '`get_text "test" `' " sets the var $V to string "text"
then strangely "get_var '$V'" sets the var $V to 0.0
but "get_text `get_var $V` " does not reset the var $V to 0.0

very disappointing
 

geposted Wed 03 Nov 21 @ 6:20 am
AdionPRO InfinityCTOMember since 2006
why are you executing "get_var '$V'" then?
 

geposted Wed 03 Nov 21 @ 2:49 pm
NicotuxHome userMember since 2014
Of course to make some animation in the forum only ^^

You wanna know why ?
I used it because it was part of an original backquoted long script that does not need extra get_text `` (and can't have it) from a format="..`...get_var $V...`..." in a skin and I was not aware about this bug
I copied the action to use it in a pad and discover that get_var in fact resets the variable

of course I fixed the script by finding ways with WORK AROUNDs

get_text `get_var $V`
param_add '' '`get_var $V`'
are both working without resetting the var

To do the same thing script differs depending on context it is used in (in short query vs action)
(format, or pad_name or custom_button name or query vs action or pad or custom button or multibutton)

but worth : The same script in query or action do not do the same thing at all :
query : get the contents of the variable (whenever it is float text bool int ... text representation for color)
action : reset the text variable to zero or get something (content for float and int; 64bit integer value cast to float for color; nothing for text). let put color out of scope... need its own investigations (specially regarding part of internal storage representation of float exposing as 32bit hexadecimal values, accessible via param_cast text n)

A get_var $V action out of `` resetting text var is simply a strange bug
why doesn't same get_var $V reset numeric variables to 0.0 as well ?

if get_var $V was returning anything or nothing useful that would be an unadjusted feature
but resetting some variables to 0.0 changing type while getting the value of other depending on content is not conceivable in any way and can't be a feature
 

geposted Wed 03 Nov 21 @ 6:27 pm
NicotuxHome userMember since 2014
Final line in the videoskin:
Automatic Ask the DJ showing with sender filter
visibility="param_equal get_askthedj_unread 0 && param_contains `param_add "get_text ','" "get_var $sender" & param_cast text` `get_var $VDJAskDJAllowed` ? pulse 25000ms : false"

note: reading askthedj appears temporary in get_display ...
 

geposted Thu 04 Nov 21 @ 3:37 am
AdionPRO InfinityCTOMember since 2006
Should be fixed in 6747 (and set_var added so you can assign a string to a variable directly too)
 

geposted Sat 06 Nov 21 @ 7:21 am
NicotuxHome userMember since 2014
Thanks, sure that will help ^^
Both will make scripting easier and reduce scripts complexity and make them more readable ^^

thus no side effect "set myvar 'xxx'" gpo on creating var xxx and setting both vars myvar and xxx to zero
or directly set the content of var xxx into var myvar

good point

will set_var allow "set_var myvar -42" to store -42 in myvar directly instead of subsctracting 42 from myvar ?
that could be a third good point :)

EDIT: tested that is working ^^ good news
 

geposted Sat 06 Nov 21 @ 10:07 am
locoDogPRO InfinityModeratorMember since 2013
cast as 'absolute' for last one.
 

geposted Sat 06 Nov 21 @ 10:13 am