Scripting error

arbuxMusic
Posts: 49
Joined: Sun Aug 25, 2019 10:26 am

Re: Scripting error

Post by arbuxMusic »

Does the error log indicate which line is causing the dereference error?
ColinP
Posts: 939
Joined: Mon Aug 03, 2020 7:46 pm

Re: Scripting error

Post 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();
fishbowl.555
Posts: 2
Joined: Fri Oct 16, 2020 4:36 pm

Re: Scripting error

Post 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
arbuxMusic
Posts: 49
Joined: Sun Aug 25, 2019 10:26 am

Re: Scripting error

Post by arbuxMusic »

Thanks - have a great week.
Post Reply

Return to “Module Designer”