while statement

I copy/paste the following code and the compiler tells me that 'stanby' was not declared in this scope
I run the original code from where I copied and it's ok (?)
Can someone tell me what's happening...

My code:
void loop() {
while (PIND = 0) {
stanby(); }

void stanby() {
PORTB = 0;
}

You should post all of your code. You didn't include the 'setup()' function.

In what you've shown, you left the closing curly bracket off the 'loop()' function. If I add an empty 'setup()', plus add the missing } at the end of 'loop()', your code compiles fine.

Edit: One more thing I just spotted.
This:-while (PIND = 0)should look like this:-while (PIND == 0)

Also, please read the post by Nick Gammon at the top of this Forum, as it contains many suggestions that will increase the number of reader responses you can get. Also, before you post your code, use Ctrl-T in the IDE’s source code window to reformat your code to a common C style, Then make sure you use code tags (the </> icon) when your post your code.

void loop() {
    while (PIND = 0) {
        stanby();
    }

    void stanby() {   // YOU CAN'T DECLARE A FUNCTION INSIDE LOOP()
        PORTB = 0;
     }

Thank's guys... getting back to "scratch my head" 's desk
Regards...

Weird bit of code, what's it supposed to do?

Try removing the curly brace after (PIND=0) eg

void loop()
{
** while (PIND = 0)**
** stanby();**
}

Maybe you could post a link to the original code?