Highwinder Active Member Licensed User Longtime User Jan 6, 2012 #1 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: Code: Copy 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: Code: Copy 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
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: Code: Copy 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: Code: Copy 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 Jan 6, 2012 #2 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
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.
Highwinder Active Member Licensed User Longtime User Jan 6, 2012 #3 stevel05 said: 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. Click to expand... Yup, you're right, and I found the duplicate. Thanks! - Highwinder Upvote 0
stevel05 said: 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. Click to expand... Yup, you're right, and I found the duplicate. Thanks! - Highwinder