Page 3 of 3

Re: Scripting error

Posted: Sun Oct 18, 2020 1:09 am
by arbuxMusic
Does the error log indicate which line is causing the dereference error?

Re: Scripting error

Posted: Sun Oct 18, 2020 2:47 pm
by ColinP
Hi,

At the bottom of the code you declare volumeValue to be a double which is a primitive type rather than an object. Yet in Initialize() you are treating it as an object.

Try replacing the line..

volumeValue.SetValue(volumeKnob.GetValue());

with...

volumeValue = volumeKnob.GetValue();

Re: Scripting error

Posted: Sun Oct 18, 2020 6:29 pm
by fishbowl.555
Good Afternoon,

Wow... Thank you both. Success.

I guess I shouldn't blindly copy tutorials. Lesson learned is to do better troubleshooting (and reading Java docs) before I post. Hopefully I'll be able to return the favor and answer someone elses post at some point.


To answer your question arbuxMusic the exact error is:
---------------------------------------
c:\User\...PATH...\VolumeModule.java:69 error: double cannot be dereferenced
volumeValue.SetValue(volumeKnob.GetValue());
^

1 error
Compile failed, return code 1
-------------

And the offending block is:
-------------
@Override
public void Initialize()
{
// add your own code here

volumeValue.SetValue(volumeKnob.GetValue());

}
---------------------------------------

Yes ColinP, your answer was correct.

I relplaced:
volumeValue.SetValue(volumeKnob.GetValue());
with:
volumeValue = volumeKnob.GetValue();

I should have known that volumeValue was not an object with a method called SetValue. In fact the next section of the tutorial even shows volumeValue being set to a Double in the switch statement.


Have a great weekend both of you (and all Voltage users),
Tim

Re: Scripting error

Posted: Mon Oct 19, 2020 11:56 am
by arbuxMusic
Thanks - have a great week.