'Func-def not allowed...' error on IR MP3 controller

drwhofan:
I thought I had a clue about it but I guess not, because otherwise I wouldn't be asking for help.

It's dead simple. For each { there must be a matching }. In the end, the number of { must be equal to the number of }.

Each { } pair identifies a block of code. Just like a pair of ( ) encloses an expression.
You immediately see something missing here

if ( a== 2

don't you ? Likewise, you should see something missing here too:

while (value < 3) {  k++;

I hope this clarifies the subject.