2

I get an error message on the line returnString("testing"); that says:

DeclarationError: Undeclared identifier. returnString("testing");

function returnString (string checkers) external view returns(string) {
    return checkers;
}

function getBidders() public {
    returnString("testing"); 
}

Why wont this work?

1 Answer 1

3

It is because you are calling returnString function, declared as external from internal, declared as public function. Declare returnString function as public instead since you are calling it from inside.

function returnString (string checkers) public view returns(string) {
    return checkers;
}

Look at this answer for reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.