Scripting error
-
- Posts: 49
- Joined: Sun Aug 25, 2019 10:26 am
Re: Scripting error
Does the error log indicate which line is causing the dereference error?
Re: Scripting error
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();
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();
-
- Posts: 2
- Joined: Fri Oct 16, 2020 4:36 pm
Re: Scripting error
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
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
-
- Posts: 49
- Joined: Sun Aug 25, 2019 10:26 am
Re: Scripting error
Thanks - have a great week.