Seekbar Error during Compile

Highwinder

Active Member
Licensed User
Longtime User
I'm trying to use a seekbar as a volume control for a mediaplayer.

I'm getting the following error when I try to compile:

B4X:
Compiling code.                         Error
Error parsing program.
Error description: Parameter name cannot hide global variable name.
Occurred on line: 97
Sub volumeBar_ValueChanged (Value As Int, UserChanged As Boolean)

Here's my code:

B4X:
Sub volumeBar_ValueChanged (Value As Int, UserChanged As Boolean)
   
   'Set sound volume
   MediaPlayer1.SetVolume(volumeBar.Value /100, volumeBar.Value / 100)
      
End Sub


Can someone point out what I'm doing wrong? :BangHead:

Mucho Thanko!

- Highwinder
 

stevel05

Expert
Licensed User
Longtime User
That error occurs when you have a global variable declared with the same name as a parameter in a subroutine call, so you should find you have either Value or UserChanged declared as a global variable.
 
Upvote 0

Highwinder

Active Member
Licensed User
Longtime User
That error occurs when you have a global variable declared with the same name as a parameter in a subroutine call, so you should find you have either Value or UserChanged declared as a global variable.

Yup, you're right, and I found the duplicate.

Thanks!

- Highwinder
 
Upvote 0
Top