Hi All,
I am trying to set the volume a Beep is played at and then restore the volume. I thought this would be simple but the compiler doesn't like my code.
It looks straight forward but I'm missing something.
Any help much appreciated.
The relevant part of code.
The Compiler shows the following:
I've searched the Forum but failed.
Thanks in advance
Regards Roger
I am trying to set the volume a Beep is played at and then restore the volume. I thought this would be simple but the compiler doesn't like my code.
It looks straight forward but I'm missing something.
Any help much appreciated.
The relevant part of code.
Adjust volume:
VolMus = Beep1.VOLUME_MUSIC 'Save current volume setting in integer '
Beep1.VOLUME_MUSIC = 5 'Set volume for Beep1'
Beep1.Beep
Sleep(21)
Beep1.VOLUME_MUSIC = VolMus 'Restore setting'
The Compiler shows the following:
Compiling generated Java code. Error
B4A line: 5974
Beep1.VOLUME_MUSIC = 5
src\b4a\configulator_calculator\main.java:9066: error: cannot assign a value to final variable VOLUME_MUSIC
parent.mostCurrent._beep1.VOLUME_MUSIC = (int) (5);
I've searched the Forum but failed.
Thanks in advance
Regards Roger